BPM erroring when trying to set data tag variable

Our construction managers wanted a heads up when a re-order is shipped. Rather than creating another UD field in OrderHed, I suggested using public data tags instead. Unfortunately, I’m erroring out on the BPM when I try to get the tag!

A trace shows the CustShip.UpdateMaster BO getting triggered when the customer shipment is marked ‘shipped’. From here, I’m trying to use the CustShip.OrderNum to get to the OrderHed.SysRowID field. Then I can connect to the SysTag table for this order, and see if it has the tag ‘REO’.

The one-line of code to populate my Sysrow variable is erroring out with 'Result of expression cannot be assigned to variable of ‘System.String’ type. Why? The OrderHed.SysRowID field is x(36), which seems like a string.

Db.OrderHed.Where( r =>r.Company == callContextClient.CurrentCompany && r.OrderNum == dsShipHeadRow.OrderNum).Select( r =>r.SysRowID).FirstOrDefault()

Should I be approaching it a different way? Maybe if the orderhed has a data tag REO, I should also attach it to the customer shipment? And then use the data tag condition?

image

SysRowID is a Guid. I had never looked at Tags before, but was curious so I made a tag on a sales order. I avoid CustShip.UpdateMaster since it does a bunch of stuff on the sales order when the shipped checkbox is set. I made a Standard DD on ShipHead and there the order is held in OTSOrderNum. :man_shrugging: I set the pack to closed and got an email.

image
I used CLOSED so I can test with opening and closing, but you would want FREIGHTED or SHIPPED.
image
Check for the tag
image

1 Like