Hi,
I want to send an email alert to notify the approver when a Purchase Order (PO) is created. I use the BPM Data Directive on POApvMsg.
Here is my code :
var ttPOApvMsg_xRow = ttPOApvMsg.FirstOrDefault();
var PONum = Convert.ToInt32(ttPOApvMsg_xRow["PONum"]);
var POApvMsg_Row = Db.POApvMsg.FirstOrDefault(x => x.PONum == PONum);
var PurAgent = Db.PurAgent.FirstOrDefault(y => y.BuyerID == POApvMsg_Row.MsgTo);
BpmContext.BpmData["Character02"] = PurAgent.EMailAddress;
The lines below are to get more information about the PO from the POHeader to put into the email body, but it doesn’t work. All of them are empty. I don’t know where I am wrong. Please help me.
var POHeader_Row = Db.POHeader.FirstOrDefault(x => x.PONum == PONum);
BpmContext.BpmData["Character07"] = POHeader_Row.TotalCharges;
BpmContext.BpmData["Character08"] = POHeader_Row.OrderDate;
Thanks,
Thanh.