Alfasith AX

Alfasith AX
اللَّهُمَّ انْفَعْنِي بِمَا عَلَّمْتَنِي، وَعَلِّمْنِي مَا يَنْفَعُنِي، وَزِدْنِي عِلْمًا

Sunday, October 26, 2014

Overcome from divide by zero error in AX

Hi,

2 ways.

>>
int    a,b,c;
if(b)
    c = a / b;
else
 print " Cannot divide by zero"

OR

c  = a / minOne(b);

//it returns a itself if b is zero because minOne() returns non zero values that we passes. If it is zero then it retuns 1

Above methods is to prevent the stoppage of flow of execution.

Regards,

Saturday, October 25, 2014

Code to get multi selected records in from grid in AX

Hi,

Make that object (button) to multiselect property as "YES".
on the control (button) event method (Clicked).

void clicked()
{

     int             ListOfRecIds, i=1;
    container  contains;
    CustTable  custTableLoc; // Table_Name  that we used in as the datasource.
    super();
   
    ListOfRecIds= custTable_ds.recordsMarked().lastIndex();
    custTableLoc= custTable_ds.getFirst(1);
   
   while (custTableLoc)
    {
        contains = conIns(container, i ,custTableLoc.AccountNum)
       custTableLoc = custTable_ds.getNext();
        i++;
    }
 }
Regards,

Saturday, October 18, 2014

Delete the model files from AX

Hi,

Open the command prompt > run > cmd
cd\
cd C:\Program Files\Microsoft Dynamics AX\60\ManagementUtilities
Above location is the AX installed location.

axutil delete /model:"Payroll model" /Config:MicrosoftDynamicsAx

Here model is the concern model that needs to be deleted
& Config is the AOS name.
Note: Unless you compile you will not find the difference.

Regards,

List out all the models installed in particular instance in AX

Hi,

Open the command prompt > run > cmd
cd\
cd C:\Program Files\Microsoft Dynamics AX\60\ManagementUtilities
Above location is the AX installed location.

axutil list /Config:MicrosoftDynamicsAx

Here Config is the AOS name.



Regards,


Get a table ID in SQL / table browser - D365

Hi select ID from SysTableIdView where  SysTableIdView .Name = 'CustTable' <URL>/?cmp=<CompanyID>&mi=sysTableBrowser...