Help with PO Approval email sending too often

Hello,

I set up a data directive on the POApvMsg table so that it will send an email to each person in the PO approval chain until it is finally approved. It then sends the original person an email saying that the PO has been approved or rejected.

My problem is that when someone unchecks a PO that has already been approved to change a due date, then rechecks the Approval box, it sends the Approved email again like it just got approved.

Is there any way at all to filter out that email from sending?

If this isn’t making sense, please let me know and I will try to be more specific.

Thanks

Shawn

One way would be to add a UD field for “AlreadyApproved”. The Directive would only run when that is blank. Just make sure to set it at the end of the directive.

1 Like

I may be getting overly complicated but What happens when they do make a monetary change and the PO approval process begins again?

I understand that I would need to reset the UD field but not sure what would trigger that. Any ideas?

You might need to switch to a BPM, as the PO total isn’t stored in the POHeader.

I have been looking at the POaApvMsg table during each step and it looks like the ApproverResponse goes blank when the approval process begins again.

Would I be correct in assuming that I should clear my UD field when that happens? Or do you know of any other way the Response clears?

I’m not familiar enough with the Approval Process to know the best way to use the POApvMsg table.

It would depend on when and how the POApvMsg table is updated.

  1. Is a new record created when an existing PO changes and requires re-approval?

  2. Or does a re-approval just update the existing records?

It looks like it updates existing record.

I have yet to see more than one record per PO and I have been approving/unapproving my test PO many times, lol.

Not tested on current version, but my experience of the approved flag is that you can turn it off, make change to due date, and turn it on again without requiring approval – it only triggers the approval regime again if lines/qty/values have been altered.

How are you triggered your BPM? If you’re doing a field has changed from any to another on the Approved checkbox, it would fire each time. Perhaps if you are currently doing that, you need to find something to use as a trigger on the POApvMsg table or something.

1 Like

Sounds like his only criteria is that flag being set, since it’s a data directive, anytime the record changes for any reason and that flag is true, it’s going to fire. You could probably just change your criteria to be changing from false to true.

OK,

On my Data directive for table POaApvMsg:

  • I have a condition that looks for a 1 from the MsgType:
    • If true, sends email to get approval
    • If false, goes to next condition
  • If MsgType = 2 AND ApproverResponse not equal to "REJECTED":
    • If True, sends message saying PO Approved.
    • If False, goes to Next Condition.
  • If ApproverResponse ie "REJECTED":
    • If True, send email saying rejected.
    • Otherwise END

I created a UD field to store the AlreadyApproved boolean but not sure how to set it from the standard directive in the data directive. Any ideas? Not done too much in here lately.

I have used an additional criteria in the Data Directive in addition to the MsgType = 1 or 2. I also have “The ttPOApvMsg.MsgTo field has been changed from any to another”. This causes it to send when the approval gets kicked up to the approver’s approver, but keeps it from sending multiple times when nothing else changes. This might keep it from sending again if they increase the PO amount, though.

And you already regenerated the DB, and recycled the IIS pool?

Yep, rebooting the server now also to see if that helps.

I may have led you astray as I originally thought the DD was on the POHeader. The UD will need to be in the POApvMsg table (if that’s the one the DD is in)

I created it in the POApvMsg table.

I think I have it beat.

After creating the UD field AlreadyApproved_c, I then created a data directive In-Transaction with 2 conditions:

  • ApproverResponse = ""
    • If True, Set AlreadyApproved_c to False
    • If False, go to next condition
  • ApproverResponse = "MANUALLY UNAPPROVED"
    • If True, set AlreadyApproved_c to True
    • If False, end

I have tested it a few different ways and it seems to work for stopping the resend of the uncheck and re-check of the approved box.

It also let the emails begin again when the amount changed and the approval process restarted.

If anyone sees a situation that can cause an issue, please let me know so I can fix.

Thanks again for everyone’s help. I really appreciate it.

Shawn

1 Like