How can I get the PackNum in CustShip.ChangeStatus?

I’m trying to get the PackNum in this BPM, but it’s not a parameter. When I try to look at it in ttShipHead or ttShipDtl, there are no rows returned, despite the fact that there are shipment lines in Customer Shipment Entry.

How can I figure out what the current PackNum is when this method is called?

It looks like this method is updating with the SysRowID as the key instead of using multiple keys to do the update (Company, Plant & PackNum)
No idea why Epicor would update this way, probably simpler and more efficient for such a simple method.
I don’t know if there is a better way, but when I run into stuff like this I look up the value I need with the SysRowID provided. I usually will create a variable in the BPM and then use the Set Argument/Variable widget to set that variable to an expression like the following:
Db.ShipHead.FirstOrDefault(Sh => Sh.Company == callContextClient.CurrentCompany && Sh.SysRowID == ipShipHedRowID).PackNum

2 Likes

That works great, thank you!

1 Like

Hey Guys,

Hope its ok if I’m tagging on to this thread. I’m trying to change the status of a BPM and when I use this same method (after obtaining the sys row id) I get the following error:

Any ideas why?

Is there a ShipVia field other than ShipViaCode that needs to be filled out in the ds?

Hmmm I only see Ship Via code

Got any lines on that pack? That dataset might need ShipVia filled out for lines too, or whatever other records on that pack exist

Actually no, the larger routine deletes all lines, and if the pack is empty it should be closed/voided. I switched the status string to “Void” and that works. Thats good enough for this! I had originally wanted to use void anyways.

works perfectly

1 Like