Posts

Showing posts from July, 2015

Exporting data from AX to Excel

static void DemoExporttoExcel(Args _args) {  SysExcelApplication  xlsApplication;    SysExcelWorkBooks    xlsWorkBookCollection;    SysExcelWorkBook     xlsWorkBook;    SysExcelWorkSheets   xlsWorkSheetCollection;    SysExcelWorkSheet    xlsWorkSheet;    SysExcelRange            xlsRange;    InventDimCombination inventDimCombination;     InventDim                      inventDim;    int                  row = 1;    str                  fileName;    ;    //Filename    fileName = "C:\\demo";    //Initialize Excel instance    xlsApplication           = SysExcelApplication::construct();    //Open Excel document    //xlsApplication.visible(true);    //Create Excel WorkBook and WorkSheet    xlsWorkBookCollection    = xlsApplication.workbooks();    xlsWorkBook              = xlsWorkBookCollection.add();    xlsWorkSheetCollection   = xlsWorkBook.worksheets();    xlsWorkSheet             = xlsWorkSheetCollection.itemFromNum(1);    //Excel columns captions    xl

Creating Batch jobs using RunBaseBatch when importing data from a CSV file.

First create a new class and  extend it from RunBaseBatch. i.e.  class DemoBatchJob extends RunbaseBatch{} In the class declaration add the following. class DemoBatchJob extends RunbaseBatch  {    DialogRunbase    dlg;   DialogField       _file;   FilenameOpen   file;  # define.CurrentVersion(1)  # localmacro.CurrentList file //file variable is to keep in track the CSV file path for the batch job  # endmacro } Override the pack method.     public container pack()  { return [#CurrentVersion, #CurrentList]; }  Override the unpack method.   public boolean unpack(container _packedClass)  { Integer version = RunBase::getVersion(_packedClass);  ; switch (version) { case #CurrentVersion: [version, #CurrentList] = _packedClass; break; default: return false; } return true; } Override the dialog method.  protected Object dialog()  { dlg = super();    

Full CIL generation error : " The CIL generator found errors and could not save the new assembly"

Image
Follow the below mentioned 5 steps: Step 1:  Stop the AOS services Step 2:  Delete all of the source in the   C:\Program Files\Microsoft Dynamics AX\60\Server\MicrosoftDynamicsAX\bin\XppIL directory Step 3:  Start the AOS services Step 4:   Perform a full compile i.e full AOT Compile(it would take some time)   Perform full compilation in parallel to save time refer to the following post: Full AOT compilation in parallel using command line Once the full compilation is completed check the log file for any error during the compilation an first fix those errors.. The log can be viewed on the path:  C:\Program Files\Microsoft Dynamics AX\60\Server\MicrosoftDynamicsAX\Log Step 5:  Perform a full CIL generation Now the issue would be resolved:-)

Full AOT compilation in parallel using command line

cd \Program Files\Microsoft Dynamics AX\60\Server\<YOUR AOS NAME>\bin axbuild.exe xppcompileall /aos=01 /altbin="C:\Program Files (x86)\Microsoft Dynamics AX\60\Client\Bin" /workers=4 C:\Program Files\Microsoft Dynamics AX\60\Server\MicrosoftDynamicsAX\bin>axbuild .exe xppcompileall /s=01

Full AOT compilation in parallel using command line

cd \Program Files\Microsoft Dynamics AX\60\Server\<YOUR AOS NAME>\bin axbuild.exe xppcompileall /aos=01 /altbin="C:\Program Files (x86)\Microsoft Dynamics AX\60\Client\Bin" /workers=4 C:\Program Files\Microsoft Dynamics AX\60\Server\MicrosoftDynamicsAX\bin>axbuild.exe xppcompileall /s=01