I have a BPM that sends an email to a user if a certain field on the sales order line screen is not null. In my email I want to list the values of fields in the OrderDtl and OrderHed files. Epicor support told me that only the OrderDtl fields have value in the tt files and to do a query in the BPM to get the OrderHed values, but I have never done this before and I’m not sure how to go about this. I tried and the values are still showing up null in my email. Has anyone done this before and if you did, can you please show me how to do it correctly? Thanks!
What I would do is create an Epicor Function to return the OrderHed values you want as response parameters. Something like:
/*
Epicor Function "GetOrderHedValuesForEmail"
Request Params:
orderNum (Int32)
Response Params:
ShipViaCode (string)
PONum (string)
*/
var OrderHeader = Db.OrderHed.Where( x => x.Company == Session.CompanyID && x.OrderNum == orderNum ).FirstOrDefault();
if ( OrderHeader == null ) return;
ShipViaCode = OrderHeader.ShipViaCode;
PONum = OrderHeader.PONum;
Then Invoke that function in your BPM using and Invoke Function widget. If you set BPM variables to catch the Function Response variables, that should get you what you need.