Recently I came across a situation where I needed to validate if the inventory dimension "PalletId" is active on an item or not. After a little digging here and there, came across this piece of standard AX code to identify if an inventory dimension is active or not. It is always good to re-use standard AX code instead of writing our own logic. This helps in maintaining the quality of the code.
InventTable inventTable;
InventDimParm inventDimParm;
;
inventTable = InventTable::find('1000');
inventDimParm = InventDimParm::activeDimFlag(InventDimGroupSetup::newInventTable(inventTable));
if(inventDimParm.WMSPalletIdFlag)
{
info("Pallet Enabled");
}
Similarly we can validate other inventory dimensions as well.
that helped, thanks
ReplyDeletethanks
ReplyDeleteVery helpful for a custom report I'm working on - thanks.
ReplyDeleteThanks Priyanka
ReplyDelete