Skip to main content

Posts

Showing posts from 2014

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...

Barcode printing and scanning ax 2012 | Useful links & material

I came across client's requirement to integrate barcode scanner and printer with AX in their production process. So inventory in (pick list generation) was done using barcode scanner, and at the end of each process (RAF journal) production sticker is generated with Item id and its batch number. First of all, le tme tell you that barcode scanner is just like an external keyboard attached to system, its drive gets auto-installed in windows (I tried on windows 7). As soon as driver gets installed yoou can test the scanner by opening a notepad and scanning some barcode, which will input contained information on notepad. Same would be the case in AX. You just need to place cursor on a field and scan the barcode. No integration tool required whatsoever. So it's pretty simple and easy. I used custom code to generate code39 barcode, and added a table field (with EDT barcodeStr) to save barcode string having item and batch number separated by % symbol, so I might be able to parse ...

Developing an SSRS report using the Report Data Provider in Microsoft Dynamics AX 2012

Source: http://www.dynamics101.com/2013/09/developing-ssrs-report-using-report-data-provider-microsoft-dynamics-ax-2012/ Overview There are multiple methods to develop SSRS reports in Microsoft Dynamics AX 2012. This tutorial will guide you in developing Report Data Provider (RDP) based SSRS reports. RDP based SSRS Reports are used when complex business logic cannot be achieved using AOT query. Pre-requisites Microsoft Dynamics AX 2012 Visual studio 2012 SQL Server Reporting Services (SSRS) must be configured Reporting services extensions must be installed in Dynamics AX Important Concepts Report Data Provider (RDP) Class Report Data Provider Class is an X++ class that is used to access and process data for a SSRS report. The RDP class processes the business logic based on a specified parameter and/or query and returns a dataset to the reporting services. In order to create a RDP class in AX, you have to extend that class with SRSReportDataProviderBase . T...

MSDN: Walkthrough: Creating a Simple Default Security Policy [AX 2012]

Source: http://msdn.microsoft.com/en-us/library/hh272123.aspx Source: http://msdn.microsoft.com/EN-US/library/hh272121.aspx Overview of Security Policies for Table Records [AX 2012] Security policies enable developers and administrators to block access to subsets of data rows in tables. A policy is roughly similar to a where clause in an SQL select statement. A security permission increases the access a user has to data, but a security policy decreases access to data. In the Application Object Tree (AOT), policies are displayed under Security > Policies . Security policies are enforced in the Application Object Server (AOS). All access mechanisms that route through the AOS are subject to policy enforcement. These access mechanisms include forms, Enterprise Portal webpages, SSRS reports, and calls from class methods. An Extensible Data Security Model Microsoft Dynamics AX uses an extensible data security (XDS) model. XDS extends data security from a s...

Auto create job card journal in Production | AX 2012

Multiple journals are created in the production process. When the order is started route card journal and picking list journal are auto created. But system does not create job card journal automatically. It requires a small customization. Following method can be called when the production order is started with the production order id passed as the parameter. /// <summary> /// This method auto creates Job Card Journal and its lines against selected production order. /// </summary> private void autoCreateJobCardJournal(ProdId _prodId) {     ProdJournalTable    prodJournalTable;     ProdRoute           prodRoute;     ProdRouteJob        prodRouteJob;     ProdJournalRoute    prodJournalRoute;     ProdParametersDim   prodParametersDim;     int   ...

Create new legal entity in ax 2012 through code

I came across a scenario to create new legal entity in ax2012 through code, and wrote down following job to create legal entities. static void createLegalEntities(Args _args) {     CompanyInfo                         legalEntity;     DirPartyPostalAddressView           partyPostalAddressView;     int                                 coCount;     int                                 gap;     int      ...