BPM to find PO Box in ShipTo Address

I am working on a BPM to search for ShipTo addresses with PO Box entries. This commonly happens when we enter a new customer and the billing address is a PO box but we have not defined a default Ship To address. If our salespeople do not double-check, they may end up shipping a package to a PO Box, which gets rejected.

I am currently using a Pre-processing directive on Erp.SalesOrder.MasterUpdate with two conditions. The second condition is working, which looks for the OTS flag and checks the OTS fields with a simple “contains” expression:

My issue is trying to trigger the BPM when there is no OTS flag set. I am currently using a query to tie in the ShipTo table as such:

and here are my table relations

Can anyone offer advise as to why this does not appear to trigger when the word “box” appears in the address fields?

Does the problem only happen when ShipTo is blank? Or does it also happen when OrderHed.ShipToNum is not blank or null (ShipToNum is actually a string).

And what is the table criteria on Erp.ShipTo?

The problem was happening bth with ShipTo was blank (default) and when there was ShipTo populated.

The table criteria for Erp.ShipTo is in the second screenshot in the original post.

I was able to get the BPM working by using a simple condition on ttOrderHed.ShipToAddressList instead of trying to link the fields with a query. It doesn’t explain why the original BM wasn’t working, but it’s a functional workaround:

Thank you for the help.