Block Inventory through code in D365fo
static void inventBlocking(Args _args)
{
InventBlocking inventBlocking ;
InventDim inventDim;
;
ttsBegin;
InventBlocking.initValue();
inventBlocking.Qty=0.5;
inventBlocking.ItemId="D0001";
inventDim.InventSiteId='1';
inventDim.InventLocationId='11';
inventBlocking.InventDimId=InventDim::findOrCreate(inventDim).inventDimId;
inventBlocking.Description='inventory blocking';
inventBlocking.insert();
ttsCommit;
info(strFmt('%1- %2',inventBlocking.Description, inventBlocking.ItemId));
}
Keep Daxing!!
No comments:
Post a Comment