BPM get related data when lookup value is changing

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

try taking off the default if empty and see what comes back.

MOQ is 0 if I remove the default if empty (and both parts have a non-0 value in the field)

Sounds like that tableset is not populated with that information at that time.