Tuesday, 15 September 2015

Get list of AOT elements(objects) through code in Dynamics AX 2012

How to get list of AOT elements(objects) through code in Dynamics AX ?
Here  is the code:
UtilElements    UtilElementsLocal;
  
while select * from UtilElementsLocal
    where UtilElementsLocal.recordType == UtilElementType::ExtendedType
    && UtilElementsLocal.utilLevel == global::currentAOLayer() 
{
      info(UtilElementsLocal.name) ;
}

How to GAC a DLL when any changes are made in AX 2012

Gac a DLL, when any changes are made in the DLL? 

1. Open Visual studio x64 Win 64 Command prompt----> as administrator.
2. Command : gacutil -i <path-of-dll-with-name> (i-install, u-uninstall).

Ex: gacutil -i C:\Users\Administrator\Desktop\Demo.dll