Wednesday, January 11, 2017

Find position of item in container in ax 2012

To find position of item in container in ax 2012 you can get idea from below code. Confind method used to get position details of items for container.

 container c ;  
   int i;  
   int j;  
   ;  
   c=conPoke(c,1,"item1");  
   c=conPoke(c,2,"item2");  
   c=conPoke(c,3,"item3");  
   i = conFind(c, "item2");  
   j = conFind(c, "item3");  
   print "Position of 'item2' in container is " + int2Str(i);  
   print "Position of 'item4' in container is " + int2Str(j);  
   pause;  

Tuesday, January 3, 2017

Workflow infrastructure configuration wizard in Ax 2012

Workflow infrastructure configuration wizard.

1. Click Area Page node: System administration -> Setup -> Workflow -> Workflow infrastructure configuration.


2. Click the Next > button.

3. Switch to the Configure the workflow message processing batch job tab on the Workflow infrastructure configuration wizard form.


4. Click the Next > button.

5. Switch to the Configure the workflow due date processing batch job tab on the Workflow infrastructure configuration wizard form.


6. Click the Next > button.

7. Switch to the Configure the line-item workflow notifications batch job tab on the Workflow infrastructure configuration wizard form.




8. Change Repeat job after the specified number of minutes from '30' to '1'.

9. Click the Next > button.

10. Switch to the Completing the workflow infrastructure configuration wizard tab on the Workflow infrastructure configuration wizard form.




11. Click the Finish button.

12. Close the Workflow infrastructure configuration wizard form.

13. Click Area Page node: System administration -> Inquiries -> Batch jobs -> Batch jobs.




Saturday, December 31, 2016

Remove spaces from Text in Ax 2012

To Remove spaces from Text you can get idea from below code sample. Here we are update name fields which include spaces on right and left side .

 Dirpartytable   Dirpartytable;  
   Name Name;  
   ;  
   while select forUpdate Dirpartytable  
   {  
     ttsBegin;  
     Name= strRTrim(strLTrim(Dirpartytable.Name));  
     Dirpartytable.Name = Name;  
     Dirpartytable.doUpdate();  
     ttsCommit;  
   }  
   info("Done");  

Thursday, December 15, 2016

Cascade delete option in Ax 2012

Cascade delete option in Ax 2012 . You can apply as below image for your tables.

Cascade

Update and Update_RecordSet Code sample in Ax 2012

This is Update and Update_RecordSet Code sample. Result of both will be same .

 TestTable TestTable;  
   
//Update_Recordset
update_recordset TestTable setting Name ="New Enterprises" where TestTable.Accountnum =="uS-027";  
   
//Update
ttsBegin;  
   while select forupdate TestTable where TestTable.Accountnum =="uS-027"  
   {  
     TestTable.Name ="New Enterprises";  
     TestTable.update();  
   }  
   ttsCommit;  
   info("OK");