Thursday, November 06, 2014

How to Flush the AOS cache without restarting AOS service

Scenario: Some times, Your customization does not reflect in to AX objects. we needed to flush the cache to make sure that customization will take place, but we could not stop and start the AOS. 
The only way I have ever known to flush the AOS is to stop and start it. Well i got to know a nice little trick recently. You may or may not be aware of three menu action items that can be used to flush system data, the AOD, and dictionary. The thing about these though is that they are set to run at "called from" which when ran clear the client cache. 
SolutionWell the trick is to copy these three menu items, and then change the run from property to server. Now you can launch these menu items, and they will run on the server, therefore clearing the AOD, sys data, and dictionary, causing a refresh. 
So the three menu items that you copy (don't change the real deals) are:
[Under Menu items > Action]

1. SysFlushAOD
2. SysFlushData
3. SysFlushDictionary

Happy DAXing....... :)

Wednesday, November 05, 2014

How to write X++ methods on the list page Form in Dynamics AX 2012

Scenario: I have a menu item that calls some class to execute business logic on the list page Form. List pages do not allow writing of code on the Form, as they used interaction class.
Solution: You can write the code on list page buttons by setting DisplayTarget property to “Client” from auto. 
Note: After this change, you won’t be able to use this button on the EP, so if you are thinking of using the same list page on the EP and planning to use the same button there, then do not do it. However if you are using only the Rich client Form then you are good to do this.
Happy DAXing..... :)

Thursday, September 04, 2014

System does not support setup 'continuous' of number sequence XXX.

Hi,

Recently i faced this issue related number sequence. I Realized, the issue was that the getNewNum function was called without transaction processing. Please encapsulate your code with in transaction and it will work fine.......... :)

ttsbegin;

[Your Code]

ttscommit;

Happy DAXing......... :)

Monday, August 04, 2014

Maps in AOT (Microsoft Dynamics AX 2012)

Microsoft Dynamics AX 2012 :Maps in AOT

Maps are nothing just an element/object the makes possible to link/associate map fields with fields(same type with different names) in different tables like, I have create a MAP with field (AccountNum) and Same field exist in CustTable and also in VendTable,so I can associate field in CustTable and in VendTable with Maps, so basically  Maps enables to access the fields with different name in different tables.

EXAMPLE:
I have created a Map by navigating to AOT>Data Dictionary>Maps and right click and new and gave it name ‘MapTest’


I have created 4 fields in under Fields node in Map (drag and drop from EDT)


Now the next thing I need to do is to associate the fields in map with the fields in different tables, let say I am taking two tables (CustTable and VendTable).


Notice that above, four fields that I have created in Maps also exist in CustTable as well as VendTable with different names.
To associate fields, go to Mapping node, right click it and click New mapping, and enter the table that you want to associate in Mapping Table field. Like


And the associate fields with fields in MAP


Now I have created a method called printInfo under method node in Maps, which print the value of the map field AccNumber.

public void printInfo()
{
info(strFmt(“Map : AccountNum :%1″,this.AccNumber));
}

Similiarly I have create same methods under method nodes of CustTable and VendTable which are printing their respective AccountNumber fields


Now finally I have created a job see below I  am not describing every line as I have added comments above the line.


When I run this job see what happens


Happy DAXing......... :)




Friday, August 01, 2014

How to write methods on the list page Form in Ax 2012

How to write methods on the list page Form in Ax 2012


Scenario: I have a menu item that calls some class to do manipulation on the list page Form and I need to refresh the list page now. List pages do not allow writing of code on the Form, as they used interaction class.
Solution: You can write the code on list page buttons by setting DisplayTarget property to “Client” from auto. However after this change, you won’t be able to use this button on the EP, so if you are thinking of using the same list page on the EP and planning to use the same button there, then do not do it. However if you want to use it only in rich client then you are good to do this.
Any ways override the clicked method and call research() of the data source to do this

Happy DAXing.... :)

Enable UAT database over OneBox DevTest environment using JIT

 Dear Friends, In this Article I will show you how to enable UAT database access for Development machine using just-in-time (JIT). Many time...