Tuesday, October 20, 2020

Delete Product Master in Ax 2012 X++


 Hi guys , Today we see how to delete product master from Ax 2012 using X++


Run the below code.This code delete only Product master Not its Product dimensions and product variants.


static void deleteProduct(Args _args) 

{

    InventTable         inventTable;

    EcoResProduct           ecoResProduct;

 

   inventTable = InventTable::find('D0006',true);

   ecoResProduct = EcoResProduct::find(inventTable.Product, true);

   inventTable.delete();

   if (ecoResProduct.validateDelete())

   {

       ecoResProduct.delete();

   } 

}


Keep Daxing!!

No comments:

Post a Comment