I’m creating a BPM to prevent closing an order (hed, dtl, release eventually) when the CancelReason_c UD field is not set. I haven’t been able to get the condition to trigger on NULL or “”, so I figured I should try it with values first, but the message box doesn’t show the field is set. I’ve also tried it with ALL ROWS and THE CHANGED ROW, but it still is empty (per the message box). The BPM is always false.
CancelReason_c is linked to user codes driving a dropdown box, if that matters.
A BAQ shows that the reason was set on OrderHed.CancelReason_c.
Try creating a variable, and setting it with a “Set Arg/Var” widget. Since it is an existing record, use the “Simple one-liner” method to read the value from the real DB table, instead of the temp table.
Then reference the variable instead of the temp table field.
Thanks, Calvin! Gottit! Good news is that shipping an order doesn’t seem to use the CloseOrder bpm, so I didn’t have to figure out how to escape that use-case…
I did a Track Changes trace, and literally nothing is getting sent. It’s all in the return.
Here’s the code (first time having to use the iOrderNum parameter for me. Ooooh!):
Db.OrderHed.Where( r =>r.Company == callContextClient.CurrentCompany && r.OrderNum == iOrderNum ).Select( r =>r.CancelReason_c).FirstOrDefault()