Dec 7, 2015

Generate Xml file for XDS class in AX


static void GenerateXSDSchema_AxdCustTable(Args _args)
{

AxdCustTable    AxdCustTable;
XML             xml;
XMLDocument     xmlDocument;

;
AxdCustTable = AxdBase::newClassId(classnum(AxdCustTable));
xml          = AxdCustTable.getSchema();
xmlDocument  = XMLDocument::newXML(xml);
 
//TODO Select file to write XML output to
xmlDocument.save("D:\\XSDSchema_AxdCustTable.xml");

}

Jul 12, 2015

"CIL generation: The given key was not present in the dictionary"

If we get error on CIL generation like

"CIL generation: The given key was not present in the dictionary."

Solution is simple ..

Check the log file of CIL which located at the below path

"C:\Program Files\Microsoft Dynamics AX\60\Server\MicrosoftDynamicsAX\bin\XppIL\Dynamics.Ax.Application.dll.log"

In log we can see the AOT objects those causing to the CIL error .

Find the objects in AOT and compile , resolve the compilation errors . Make sure there are no errors and regenerate the CIL .

Problem get resolved....enjoy.........  :)

 

Mar 23, 2015

Syntax of Try {} catch {} for updation in X++

void clicked()
{

#OCCRetryCount   

#task;  

super();

try

     // logic
}
catch (Exception::Deadlock)

{
      retry;

}
catch (Exception::UpdateConflict)

{
       if (appl.ttsLevel() == 0)

      {
           if (xSession::currentRetryCount() >= #RetryNum)

          {
                throw Exception::UpdateConflictNotRecovered;

          }
      else

     {
           retry;

     }
}
else

{
     throw Exception::UpdateConflict;

}
}
catch (Exception::Error)

{
       throw error("Label");

}
    Table_ds.research();

}