Click here to Skip to main content
15,888,401 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
hi i want to create new distinct product in AX 2012 using X++.
I'm new in this environment and I hope to give me good explanation about how to know the tables that i have to fill it to be apple to release the product later.

I just used this code to create new product, but when I can not release it. why? and how can fix it?

static void CCED_CreateNewProduct(Args _args)
{
//inisalization
InventTable inventTable;
EcoResProductTranslation ecoResProductTranslation;
EcoResProduct ecoResProduct;
EcoResProductNumberBuilder ecoResProductNumberBuilder;
InventModelGroupItem InventModelGroupItem;

//create new Product by inserting data to these 4 tables
ecoResProduct = null;
ecoResProduct = new SysDictTable(tableNum(EcoResDistinctProduct)).makeRecord();
ecoResProductNumberBuilder = EcoResProductNumberBuilder::newFromProductNumber("ABCD123");
ecoResProduct.DisplayProductNumber = ecoResProductNumberBuilder.buildDisplayProductNumber();
ecoResProduct.ProductType = EcoResProductType::Item;
ecoResProduct.productSubtype = EcoResProductSubtype::Product;
ecoResProduct.validateWrite();
ecoResProduct.insert();

}

thanks
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900