August 30, 2013

Print PDF files from AX X++ code

Print External PDF file from AX 

This job illustrates how we can print an external PDF file to a printer chosen in AX through X++ code. Here a code sample (X++ job) to do this.

static void theAxapta_pdfprint(Args _args)
{ 
    PrintJobSettings    printJobSettings = new PrintJobSettings(); 
    Dialog              dialog = new Dialog(); 
    DialogField         dialogFileName; 
    str                 adobeExe; 
    str                 adobeParm; 
;
    dialogFilename  = dialog.addField(typeid(FilenameOpen));

    if (dialog.run()) 
    {     
        printJobSettings.printerSettings('SysPrintForm');     
        adobeExe = WinAPI::findExecutable(dialogFileName.value());
       
        adobeParm = strFmt(' /t "%1" "%2" "%3" "%4"',
                           dialogFileName.value(),
                           printJobSettings.printerPrinterName(),
                           printJobSettings.printerDriverName(),
                           printJobSettings.printerPortName());

        winAPI::shellExecute(adobeExe,  adobeParm); 
    }
}

-Harry

Dynamics AX 2012 Certification Exams Details- Part I

Dynamics AX 2012 Certification Exams Details- Part I



Exam title Exam number
Microsoft Dynamics AX 2012 Trade and Logistics MB6-870
Microsoft Dynamics AX 2012 Financials MB6-871
Microsoft Dynamics AX 2012 Development Introduction MB6-869
Microsoft Dynamics AX 2012 Installation and Configuration MB6-872
Microsoft Dynamics AX 2012 Process Manufacturing Production and Logistics MB6-886
Microsoft Dynamics AX 2012 Lean Manufacturing MB6-884
Microsoft Dynamics AX 2012 Public Sector MB6-885
Microsoft Dynamics AX 2012 Service Management MB6-889