I’m trying to create product/master product in Dynamics AX using AIF inbound port, the AIF services consume by C#.NET.
From AX 2012 R2, Item is replaced with Product. Item master was in Inventory Management Module, now there is a separate module for item/product creation Product information Management.
Some definitions you should know
There are two types of Products in 2012 they are:
Product information management/Common/Products/Products
Product information management/Common/Products/Products master
To create a product variant, you must define at least one product dimension for a product master. You can also rename dimensions.
To create product variants, you must complete the following tasks:
Set up dimensions, such as size, color, and style.
Set up variant groups.
Assign variant groups to a retail hierarchy.
Create a product master and variants.
b. Product dimensions
Product dimensions are characteristics that serve to identify a product variant. You can use combinations of product dimensions to define product variants. You must define at least one product dimension for a product master to create a product variant.
Normally in AX, we create items master follow process:
Assigning Item Model Group & Item Groups to a Product Master
How to do:
Ax provides us standard services for this purpose, so we don’t need to create any custom services for this. I will use 4 services for this purpose, descriptions below
Create products (all types). The service can also be used to retrieve data that has already been created (Create Product details in The EcoRes tables).
Specify values of product dimensions for a product master. These values become available for the creation of product variants. The service can also be used to retrieve data that has already been created.
Release distinct products and product masters. The service can also be used to retrieve data that has already been created.
Release product variants. The service can also be used to retrieve data that has already been created.
we have 4 steps
Create 4 AIF inbound services against Services operation above and active it
After services creation, open visual studio then creates new Console project and add service References for that, you will get somethings like pic below:
Using C#.Net to consume service
this method can use to release a distinct product or a product master
Release product Variants
Just for example, in main I only create Distinct product and release it, but you can use another method to create master, variant, masterDim and so on.
4. Try to run it and here is a result
Thank you for reading and feel free to give me a question.
The Microsoft Dynamics AX runtime manages the storage of value type data on the call stack and reference type objects on the memory heap.
The call stack is the memory structure that holds data about the active methods called during program execution. The memory heap is the memory area that allocates storage for objects that are destroyed automatically by the Microsoft Dynamics AX run-time.
Value types include the built-in primitive types, extended data types, enumeration types, and built-in collection types.
The primitive types are boolean, int, int64, real, date, utcDateTime, timeofday, str, and guid.
The extended data types are specialized primitive types and specialized base enumerations.
The enumeration types are base enumerations and extended data types.
The collection types are the built-in array and container types.
By default, variables declared as value types are assigned their zero value by the Microsoft Dynamics AX runtime. These variables can’t be set to null. Variable values are copied when variables are used to invoke methods and when they are used in assignment statements. Therefore, two value type variables can’t reference the same value.
Reference types include the record types, class types, and interface types.
The record types are table, map, and view. User-defined record types are dynamically composed from application model layers. Microsoft Dynamics AX runtime record types are exposed in the system application programming interface (API). Although the methods are not visible in the AOT, all record types implement the methods that are members of the system xRecord type, a Microsoft Dynamics AX runtime class type.
User-defined class types are dynamically composed from application model layers and Microsoft Dynamics AX runtime class types exposed in the system API.
Interface types are type specifications and can’t be instantiated in the Microsoft Dynamics AX runtime. Class types can, however, implement interfaces. Variables declared as reference types contain references to objects that the Microsoft Dynamics AX runtime instantiates from dynamically composed types defined in the application model layering system and from types exposed in the system API. The Microsoft Dynamics AX runtime also performs memory deallocation (garbage collection) for these objects when they are no longer referenced.
Reference variables declared as record types reference objects that the Microsoft Dynamics AX runtime instantiates automatically. Class type objects are programmatically instantiated using the new operator. Copies of object references are passed as reference parameters in method calls and are assigned to reference variables, so two variables can reference the same object.