19 Aug 2013

Set Default Order Settings for an Item + AX 2012

static void Set_DefaultOrderSettings(Args _args)
{
InventTable inventTable;
InventItemInventSetup invent;
InventItemPurchSetup purch;
InventItemSalesSetup sales;
;
delete_from invent;
delete_from purch;
delete_from sales;

while select inventTable
{
if(!InventItemPurchSetup::findDefault(inventTable.ItemId))
{
InventItemPurchSetup::insertDefault(inventTable.ItemId);
}

if(!InventItemInventSetup::findDefault(inventTable.ItemId))
{
InventItemInventSetup::insertDefault(inventTable.ItemId);
}
if(!InventItemSalesSetup::findDefault(inventTable.ItemId))
{
InventItemSalesSetup::insertDefault(inventTable.ItemId);
}
}
}
If you have deleted the Item master and imported with new items then run this job to automatically insert the default order settings for the all items..
Otherwise system will not allow u to create any item transactions it will give error like"No Item parameter for the item"..

No comments:

Create number sequence in D365 FO

Create the data type. Add code in the loadModule method of the appropriate NumberSeqModule subclass. Add a method to the module’s paramet...