Hi, Microsoft has enhanced its AIF document services stack considerably in the new release of Dynamics AX 2012.

The whole new concept of product management has also been introduced in AX 2012. In this post I am going to discuss how the out-of-the-box document service EcoResProductService can be used to create new distinct products. The following code piece is enough to create a new distinct product using services:

AxdEntity_Product_EcoResDistinctProduct distinctProduct = new AxdEntity_Product_EcoResDistinctProduct()

                    {

                        DisplayProductNumber = “Test123”,

                        ProductType = AxdEnum_EcoResProductType.Item;

 

 

                    };

 

                    distinctProduct.Translation = new AxdEntity_Translation[]

                {

                    new AxdEntity_Translation(){ Description=“Test Product”, LanguageId=“en-us”, Name = “Test Product”}

                };

                    distinctProduct.Identifier = new AxdEntity_Identifier[]{

                    new AxdEntity_Identifier(){ ProductNumber=“Test123”}

                };

 

                    EcoResProductServiceClient client = new EcoResProductServiceClient();

                    AxdEcoResProduct product1 = new AxdEcoResProduct() { Product = new AxdEntity_Product_EcoResProduct[] { distinctProduct } };

 

                    client.create(null, product1);

 

Similarly, you can also specify other product options like storage and tracking dimension groups.

Happy DAXing:)

Leave a Reply

Your email address will not be published. Required fields are marked *

Recent Comments

    Archives

    Categories