PO Approval BPM Broken after upgrade to 10.2.200.9

I have the same problem. It used to work on 10.0 but now there is no “P” on the ApprovalStatus field anymore so my BPM on the ChangeApproveSwitch Post Process no longer sends the email (no longer triggers). I am going to try the widget if I can figure it out.

Travis,
So your BPM sends the email out but with empty fields? I can’t even trigger mine to send out. Would you be able to share your code and maybe it will resolve my issue? Thanks.

Mine stopped working also. No help from support, they suggested a Data directive as Dan did.

Jeffrey,

I did get mine working. I’ll put together the code and some screen shots of the widgets used and send it later this week.

2 Likes

Here is a write up on the BPM. I have code for a multi-approver setup if needed.

PO_Approval_BPM.docx (197.3 KB)

3 Likes

Thanks Travis. I will try this code and let you know if it works for me.

Travis, is this code E9? 10.1 does not have ttPOHeader.Shortchar02 (or any ShortChar fields).

Thanks.

It is for E10. ttPOheader.ShortChar02 is apart of my dataset for POHeader since it had data in it during the transition from E9 to E10. You can add ShortChar02 in UD Table Maintenance, or you can create your own UD Field and update the code and e-mail widget with that UD Field.

1 Like

Travis,

It does not work for me. Unfortunately, there is no “P” when the method runs so the BPM does not trigger. I already reported this to Epicor and hopefully they will have an answer. One last thing, I just need to confirm if it’s also happening on your side, can you run a trace log on when the Approve checkbox is checked? then look at all the ApprovalStatus fields on all method and see which method is using to set the ApprovalStatus to “P”. I would appreciate it. Thanks.

The POHeader.Approve fields changes from False to True during the ChangeApproveSwitch method, but the ApprovalStatus field is still set to ‘U’. The ApprovalStatus doesn’t get changed to ‘P’ until the ChangedApproveSwitch gets called after the Update method according to the trace I’ve done.

Does the shape beside the checkbox in the UI change to yellow with ‘Pending’ in the shape?

Yes, the shape beside the checkbox does change to Pending. According to my trace, the ApprovalStatus always stays at “U” even after the Update method. Do you think you can send me your trace log file for comparison?

Here is my trace.

POApprovalTrace.txt (250.4 KB)

Here is an example I’ve built onto POApvMsg.
Please ignore the first condition as it just ignores a certain group.

Erp.Tables.PurAgent PurAgent;
Erp.Tables.POHeader POHeader;
Erp.Tables.Vendor Vendor;
var ttPOApvMsg_xRow=(from ttPOApvMsg_Row in ttPOApvMsg
where string.Compare(ttPOApvMsg_Row.RowMod ,“U” ,true)==0|| string.Compare(ttPOApvMsg_Row.RowMod ,“A”
,true)==0 select ttPOApvMsg_Row).FirstOrDefault();
string AppPerson = string.Empty;
string VendorName = string.Empty;
int VendorNum = 0;
string EntryPerson = string.Empty;
if(ttPOApvMsg_xRow != null)
{
PurAgent =(from PurAgent_Row in Db.PurAgent
where PurAgent_Row.Company == Session.CompanyID && string.Compare(PurAgent_Row.BuyerID,ttPOApvMsg_xRow.MsgTo,true)== 0
select PurAgent_Row).FirstOrDefault();

  AppPerson = PurAgent.EMailAddress;

  POHeader =(from POHeader_Row in Db.POHeader
  where POHeader_Row.Company == Session.CompanyID && POHeader_Row.PONum == ttPOApvMsg_xRow.PONum
  select POHeader_Row).FirstOrDefault();

  VendorNum = POHeader.VendorNum;

  Vendor =(from Vendor_Row in Db.Vendor
  where Vendor_Row.Company == Session.CompanyID && Vendor_Row.VendorNum == VendorNum
  select Vendor_Row).FirstOrDefault();

  	VendorName = Vendor.Name;
  
  EntryPerson = POHeader.EntryPerson;

  if(PurAgent != null && POHeader != null){
     callContextBpmData.Character01 = AppPerson;	
     callContextBpmData.Character02 = VendorName;	
     callContextBpmData.Character03 = EntryPerson;
  	}
}

We have messages sending to the original user when the PO gets its final approval. It uses the same custom code but with the condition being “2” instead of “1”

2 Likes

I am running Epicor 10.1.400.20 the only value for ApprovalStatus is “U” for unapproved PO and “A” for approved onse, so without looking to your way of constructing your BPM, if i were you i will go around the “P” value problem, by changing the “P” condition to be ApprovalStatus field equal “A” on post-process ChangeAprroveSwitch method, and that is it.


you can try this simple modification

Yes you are correct. ApprovalStatus on 10.1 seems to be stucked at “U”. hmmm… I will try your suggestion and let you know.

Thanks Dan. this looks like this is on the final approval and I have this already working on the ttPOApvMsg method. I am needing help on the ChangeApproveSwitch to notify the approval person.

Travis,

Your trace shows the “P” on the PODataSet and not in a method. I don’t think I can trigger it from there since it’s not in a method. Sorry I am just an average BPM guy so I maybe wrong in that statement. My trace shows the same thing as your trace. I see the “P” but I don’t know how to trigger the BPM from that.

The bpm i’ve posted sends an email to the next person in approval all the way up because it looks at message type 1 each time meaning when its created, approval at a lower level and the next approver and so on. only when it sees a message type 2 does it shoot a response back down to the lowest level (person that cut the PO). So if there are 3 approvers it will email each of them as the approver below moves it up the chain. then the final email back down to the original person.

2 Likes

Thanks Dan, I will try your code and let you know if it works on ours.