Send Email when Purchase Order is Approved or Rejected

In Epicor 9, I had a BAM sent up that sent an email to the buyer when the PO was approved or rejected. It is not compatible in Epicor 10. I have not been able to figure out how to set this up in 10. The buyer’s email (PurAgent.EMailAddress) is not in the POHeader table. This has been a stumbling block for me. I think this probably very simple. Any help on this would be much appreciated.

Frankly, I am surprised that Epicor does not have this set up as a global alert. Buyers need to be notified when their PO is approved or rejected.

Thanks again!

Hi,

I created a standard data directive on the POApvMsg table

It emails the approver when an PO needs approving and emails the buyer when a PO has either been approved or rejected.

Cheers,

Andrew.

1 Like

Hi, Thanks, It looks like this has custom code, a bit advanced for me without the code.
I thought this would be a very simple directive to write for a novice :slight_smile:
I managed to get it done in epicor 9.

Just an FYI - the global alerts in E10 aren’t very reliable.

Below is some (credit to @josecgomez) to grab a single field value from a database table. In your DD you could create a variable, the use a set variable widget with the following expression

Db.PurAgent.Where( r =>r.Company == CurrentCompany && r.PurAgent == Buyer).Select( r =>r.EMailAddress).DefaultIfEmpty("").FirstOrDefault(); 

You’ll need to tweak the CurrentCompany and the Buyer parts. CurComp should come CallContext.
Buyer shoukd come from the POHeader table.

1 Like

Yeah, E10 conventions might take some getting used to but once you get thru a couple of these I think you’ll like it.

If you have a test system & want to play around, here is a REALLY simple method directive.
When Approved is toggled on a PO, it pulls email via custom code and displays some details.

POApprove_GetBuyerEmail.bpm (30.2 KB)

Ref screen shot
image

1 Like

I agree with @bordway once you get a few down you will like it. I had a bunch of BAMs in E9 and this is how I converted them. You can reuse the code for most alerts.
This is on a standard data directive.

I set a condition:
image

Then called an E10 version of a BAM .p program in the custom code.Alert PO Approved.bpm (17.9 KB)

2 Likes

Thanks Everyone! I found a post from 2018 which gave me the code and is super easy to follow, for novices like me. Many thanks for this post.

1 Like

@aclements i like your solution, clean. Just sending some kudos.

Why Not? Epicor swears by them as the best thing since Cottage Cheese :slight_smile:

Take it up with …

1 Like

Does anyone happen to know if this works for emailing the approval when there are more than 1 level? IE Buyer needs their approver to approve, then their approver needs to approve?

Disregard, was able to figure it out