Skip to main content

Posts

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

Filter records in form by code

Courtesy: http://dynamics-ax-live.blogspot.com/2010/03/how-to-filter-records-in-form-by-code.html Step 1: Declare a class variable In the ClassDeclaration method of the form, define a range. QueryBuildRange CurrencyQBR; Step 2: Instantiate the new range. In the init method on the datasource of the form, you assign the range to a specific field (after the super call). public void init() { super(); CurrencyQBR = this.query().dataSourceName('CustTable').addRange(fieldnum(CustTable,Currency)); } Step 3: In the last step, you assign a value to the range. This is done in the executeQuery method on the same datasource of the form. Before the super call. Like this: public void executeQuery() { ; CurrencyQBR.value(queryvalue('USD')); super(); }

Maintaining Data Integrity [AX 2012]

Reference: http://msdn.microsoft.com/EN-US/library/aa672802.aspx   You can maintain database integrity by using one or more of the following features: A  DeleteAction  element maintains database consistency when a record is deleted. For more information about adding a  DeleteAction  element, see  How to: Create Delete Actions . The  ttsbegin ,  ttscommit , and  ttsabort  keywords ensure that all changes that are associated with a transaction are completed successfully. If the changes are not successfully completed, the transaction is aborted and the database is rolled back to the initial state. The  UnitofWork  class can simplify the task of modifying the data records in multiple tables within the scope of a single transaction. For more information, see  How to: Use the UnitOfWork Class to Manage Database Transactions .