Dabbling in BPM - looking for some guidance from you more experienced folk.
I have a BPM set up to send an email when a customer is placed on credit hold. I would like to include in the same email the total value of open orders for that same customer when the alert goes out.
Ideas on the best way to accomplish this? It looks like custom code is required here.
I like @Hally 's idea and it is certainly one way to do it that is pretty straightforward.
Another idea you might consider that would leverage existing Epicor features/reports:
Use the AutoPrint widget in the Standard Directive and output to email. You can select an AR Aging report filtered to that customer and/or a Sales Order Backlog report filtered to that customer. The only “downside” of emailing using this method is that it’s a simplified email formatting window where you can only directly specify the fields.
Bonus:
If you use Advanced Print Routing (APR), you can select a report style with a routing and then you can do APR things with the email if you want… In the AutoPrint widget you could set it to AutoPreview and then in the routing send the email so it doesn’t pop up to the user that triggered the BPM. Let me know if you have any interest in this route (haha pun intended). I will do some testing.
Hi
You can do this using a combination of pre and post Method Directives on the Customer.Update Method/BO
Create a pre-processing directive with the folowing condition: The ds.Customer.CreditHold field has been changed from False to Other
Then add a Set BPM Data Field widget
Set the callContextBpmData.Number01 field of the BPM Data to the ds.CustomerRow.TotOrderCredit expression
Then add an Enable Post Processing Directive widget
Now create a Post-Processing Directive with the following condition: This directive has been enabled from the XXXX directive
where XXXX is the name you gave your pre-processing directive
Then add a Send Email widget where you can incorporate not only the standard dataset fields (customer id, name etc. but also the callContextBPM data value)
As per a previous post, if you want to include the open invoice value as well as the open order value then you can populate callContextBpmData.Number02 with ds.CustomerRow.TotInvoiceCredit so that this value can be included in the email as well.
If you are using Global Credit (i.e. shared credit across multiple companies for the same customer) then you will probably need to tweak the above to use the Glb prefixed fields