Automation Studio: PO Approval via Email

Hello!

We’ve recently gained access to Epicor’s Automation Studio, and one of the things we were excited to get set up right away was the PO Approval. I followed along with the industry templates (“Approval Processing for PO above threshold,” “Approval Request for PO Above Threshold,” “Send Email With Epicor Banner and Buttons,” and “Function Email”), though I did have to do some tweaking to make them actually pull PO limits, the approver’s email, yadda yadda.

I’ve got it all mostly figured out, except… well - I can’t seem to get the POs actually approved. One thing I noticed, the template out the box had a trigger of Approve = false. But, a PO that’s pending approval has Approve = true, and ApprovalStatus = P. That was my first doozy to figure out, but that’s all set now. However, when I go to actually approve the PO via email, I run into a problem:

  • With a PO with the status of Approve = true, it says I am not permitted to change/update the ApprovalStatus while Approve is already equal to true.

  • If I try to do a workaround where I unapprove the PO, set ApprovalStatus to A, then re-approve the PO – it automatically then sets the ApprovalStatus back to P upon the approving

Is there something I’m missing, a step I’m skipping? We’re excited to get this working, and I feel like there should surely be a simple solution to this, but… it’s escaping me!

Thank you for any and all help!

Hi erikgeorge - did you ever get the complete process working? We would like to do the same thing and wanted to know if we could buy a copy of yours, if that is possible, nsa.
Thanks. Mark

2 Likes

What were you trying to change? If I recall, the ApprovalStatus must change from P to A to be considered “Approved”. Using the business object, you must be an authorized user of the Buyer that is the “Approver” of the buyer on that PO. If that makes sense.

Buyer A is on the PO that is pending, Buyer B approves Buyer A’s POs. You’d need to set the user of the account that is being used in Automation Studio to be an Authorized user of Buyer B. At least, that’s how the regular PO Approval process works within Epicor’s UI. I assume the Automation Studio leverages the standard services/methods so I would expect the same.

Hi Mac!

Sorry for the lack of response. A combo of a busy personal life and work life took me away from this thread. I’ve spent a lot of time on this topic though, and finally do have it all working. While a quick buck is always nice, I’m happy to share how we got this working:

First - the “Approval Request for PO Above Threshold”

  • The working trigger is “New/updated POs in Epicor Kinetic”
    • This is triggered when a record is created or updated in the POs list, with the condition of “IF Approval status equals P”
  • The recipe then searches “PO Apv Msgs” in Epicor Kinetic, with the following conditions:
    • “PO number equals PO number” [Taken from the first step, new/updated PO]
    • “Msg type equals 1”
  • Then, we have an IF statement – IF “Msg type [taken from PO Apv Msgs] is present”:
    • Get PO in Epicor Kinetic (where PO number equals the PO number from step 1)
    • Get Pur Agents in Epicor Kinetic (where Buyer ID equals Buyer ID from the previous step ( :point_up_2: ))
    • Get Pur Agents in Epicor Kinetic (where Buyer ID equals Approval person from the previous step ( :point_up_2: ))
    • Call ‘Send Email With Epicor Banner and Buttons’ – This sends the webhook to the approver that contains the action, approver, buyer, po number, supplier information, and the buyer’s email

Second - the “Approval Processing for PO above threshold”

  • This is triggered by the webhook, and takes the information sent above.
  • This recipe is very messy on my end, because I have several checks. But I’ll only cover the essentials of approving / rejecting:
  • IF Action equals Approve:
    • Search POs in Epicor Kinetic (where PO number equals Po No [from Webhook])
    • Search PO Apv Msgs in Epicor Kinetic (Where PO number equals Po No [from Webhook] and Msg type equals 1)
    • IF PO number is present (from the previous step ( :point_up_2: )))
    • Update PO Apv Msg in Epicor Kinetic —This is the big step!----
      • PO number = PO number (from PO Apv Msgs)
      • Approver response = APPROVED
      • Dcd user ID = Dcd user ID (from PO Apv Msgs)
      • Apv amount = Total order (from PO)
    • Email is sent notifying buyer of approval
  • ELSE (AKA, Reject):
    • Search POs in Epicor Kinetic (where PO number equals Po No [from Webhook])
    • Search PO Apv Msgs in Epicor Kinetic (Where PO number equals Po No [from Webhook] and Msg type equals 1)
    • IF PO number is present (from the previous step ( :point_up_2: )))
    • Update PO Apv Msg in Epicor Kinetic
      • PO number = PO number (from PO Apv Msgs)
      • Approver response = REJECTED
      • Dcd user ID = Dcd user ID (from PO Apv Msgs)
      • Apv amount = [blank]
    • Email is sent notifying buyer of rejection

Like I said, I’ve got some extras that I cut out just for time in posting this. But, let me know if you try it, and if it works. And, all future browsers of EpiUsers facing the same issue… please, let me know if this worked for you!!! It took me far too long to get it working, for what it ended up being…

2 Likes

Better late than never! Thank you for following up and contributing to this wonderful community! That’s what makes it the best, people like you!

Thank You!