10.2.700.6 - on prem
In sales order entry, we would like to populate a variable with a value from the part master when the part number on a line is changed. Some of our parts have minimum order quantities and if the user changes the part number or selling quantity on an already-saved line, we want to evaluate the change and see if the quantity meets the minimum for that part.
The post-processing method directive on ChangeSellingQtyMaster appears to work as expected.
The challenge is with ChangePartNumMaster because PartNum is what is used to retrieve the data.
For now I have been working with a very simple BPM, just to get the variable populated. It has two components:
Set Argument/Variable to:
Db.Part
.Where(
r => r.Company == callContextClient.CurrentCompany
&& r.PartNum == ttOrderDtlRow.PartNum)
.Select( r =>r.MinSalesLineQty_c)
.DefaultIfEmpty(-1)
.FirstOrDefault()
Show Message:
Part:
MOQ:
When the part number is changed, the message displayed is:
Part: OLDNUM; NEWNUM
MOQ: -1
Both parts do have a value in the MOQ field.
I first tried this as a pre-processing directive, but it looked up OLDNUM instead of NEWNUM.
I am hopeful that I am missing something simple…
Thanks.
—sam