Validate dimension setup on item

static void checkDimOnItem(Args _args) { InventTable inventTable = InventTable::find("123"); InventDimSearch dimSearch; InventBatchId parmBatchId = "abc"; ; if (inventTable.BatchNumGroupId == "" || InventNumGroup::find(inventTable.BatchNumGroupId).ManualAllocation == NoYes::Yes) { dimSearch = new InventDimSearch(); dimSearch.find(inventTable.DimGroupId, fieldnum(InventDim, InventBatchId)); if (dimSearch.dimActive() == NoYes::Yes && dimSearch.dimAllowBlankReceipt() == NoYes::No && parmBatchId == "") { throw error("Inventory dimension Batch number must be specified."); } } }

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.