Skip to main content

Posts

Creating BOM journal using code AX 2012

courtesy: http://www.andesoft.net/creating-bom-journal-using-x-code-ax-2009-ax-2012/ https://community.dynamics.com/ax/f/33/t/96262.aspx http://learnax.blogspot.com/2010/01/x-code-to-create-and-post-inventory.html static void createBomJournal_working(Args _args) {     InventJournalTable      journalTable;     InventJournalTrans      journalTrans;     InventJournalTableData  journalTableData;     InventJournalTransData  journalTransData;     InventTable             inventTable;     InventDim               inventDim;     Counter                 cnt;     InventJournalCheckPost  journalCheckPost = new InventJournalCheckPost();     InventTransId           inventTransId, inventTransIdFather;     InventBat...

Get Position and Department of an employee | AX 2012

A simple job to get position/designation and department of an employee using employee id: static void WorkerPositionDepartment(Args _args) {     HcmWorker                       hcmWorker;     HcmPositionWorkerAssignment     hcmPositionWorkerAssignment;     OMOperatingUnit                 oMOperatingUnit;     HcmPositionDetail               hcmPositionDetail;     HcmJob                          hcmJob;     HcmPosition             ...

Run SSRS report using x++ code | AX 2012

This post describes how to run an SSRS report through x++ code and passing report parameters as well. Its a simple code and comments are added for further ease in code understanding! public static void runSSRSReport() {     SrsReportRunController controller;             controller = new SrsReportRunController();     controller.parmLoadFromSysLastValue(false);      // write report name and its design in quotes that you want to run     controller.parmReportName("ReportName.DesignName");      // set additional, optional properties like setting landscape to true     controller.parmReportContract().parmPrintSettings().landscape(true);          // set print destination screen/printer/file etc.     controller.parmReportContract().parmPrintSettings().printMediumType (SRSPrintMediumType::S...

Catching a key stroke in AX 2012

Courtesy: http://www.doens.be/2010/03/catching-a-key-press/ When you want to catch a key-stroke on a form, you can override the method task() The default method will look like this: public int task ( int _taskId ) { int ret; ret = super ( _taskId ) ; // write you're code here return ret; } Now you just need to check the _taskId , to know witch key you have stroke. You can compare this withe the values from the Task-macro. // Task-ID values, to be used with formControl's // return value from the method task() //--------------------------------------------------------   #define. taskF1 ( 257 ) #define. taskCtrlQ ( 264 ) #define. taskEnter ( 288 ) #define. taskShiftEnter ( 307 ) #define. taskNew ( 260 ) #define. taskSave ( 272 )   #define. taskShortCutMenuKey ( 519 ) #define. taskAlt ( 520 )   #define. taskCut ( 770 ) #define. taskCopy ( 771 ) #define. taskPaste ( 772 )   #define. taskDeleteKey ( 773 ) #define. tas...