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.
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.
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.
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.
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.
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)