Max Nguyen

This post is our own opinion and does not necessarily reflect the opinion or view of our companies or Microsoft.

AIF Custom response value in Dynamics AX 2012 R3

For this demonstration, I use AIF service to create Sales order with SalesSalesOrderService and I gonna consume AIF using C#.NET.

Normally, in consume service application we handle return value by using EntityKeyList, EntityKey, KeyData[0].Value. And for Sales Order It will return Created SalesID.

Let’s take a look on AxdSalesOrder class. More about Axd class please prefer this.

Then go to createList method, this method will handle response value

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
public AifEntityKeyList createList(
    AifDocumentXml                  _xml,
    AifEndpointActionPolicyInfo     _actionPolicyInfo,
    AifConstraintListCollection     _constraintListCollection)
{
    AifEntityKeyList aifEntityKeyList;

    aifEntityKeyList = super(_xml, _actionPolicyInfo, _constraintListCollection);

    // Sales orders are committed - master planning explosion can be executed and confirmed dates be set
    this.postSalesOrderCreation(aifEntityKeyList);

    return aifEntityKeyList;
}

So, how about customer wants another meaning value beside SalesID likes InventTransId information in SalesLine table or another tables base on your requirement. To do that, we need to customize this method.

Simple summary Keys are in Dynamics AX

There is a maximum of one Primary Key per table, whereas a table can have several alternate keys. The primary key is usually the type of key that other tables, called child tables, refer to when a foreign key field in those other tables need a relational identifier. For new tables the default is a primary key based on the RecId field , incremented number or a completely meaningless number that is generated by the system surrogate key.

AX1004 error in Dynamics AX

I got this error at version Dynamics 2012 R3 CU9, SQL Server 2014, Windows Server 2012 R2. Those kind of errors will come when you move report from Dev Server to Live Server, even compilation in DP Class, Query, Contract, table … without any error Image_roundedImage " Image_rounded {:.rounded} AX1004: Reference System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 was not a valid model assembly. MSB3644: The reference assemblies for framework β€œ.NETFramework,Version=v4.0” were not found.

Recalculate InventSum in Dynamics AX

InventSum is needed to recalculate sometimes. We should use InventSumRecalcItem class in Dynamics AX. 1 2 3 4 5 InventSumRecalcItem InventSumRecalcItem; ; InventSumRecalcItem = new InventSumRecalcItem("ITEM001", true, checkfix::fix); InventSumRecalcItem.updatenow(); First parameter : ItemId Second parameter : Show errors Third parameter : Fix or only check What if you want to calculate for all items: 1 2 3 4 5 6 7 8 9 InventTable InventTable; InventSumRecalcItem InventSumRecalcItem; WHILE SELECT InventTable WHERE (InventTable.

Simple summary Keys are in Dynamics AX

There is a maximum of one Primary Key per table, whereas a table can have several alternate keys. The primary key is usually the type of key that other tables, called child tables, refer to when a foreign key field in those other tables need a relational identifier. For new tables the default is a primary key based on the RecId field , incremented number or a completely meaningless number that is generated by the system surrogate key.

Using Methods in Table Filters & Query Ranges in Dynamics AX 2012

In Dynamics AX, there is a class called SysQueryRangeUtil that can be utilized in both query ranges and table filters. Using methods from this class allow you to be very precise about what dates you want to use in reports or for filtering your data. Let’s say you have a report that you always want to run to see orders with shipping dates of the next day. It is possible to do so by using one of the methods from the SysQueryRangeUtil.