Email Order Acknowledgement to Salespersons

,

I am using SSRS print routing to send order acknowledgments to each person listed in SalesRepList on OrderHed. Open to any suggestions but my specific question is this:

Using In-Transaction DD on OrderHed, I am setting a variable image
for the first SalesRepCode from the list. I can then take that and set a field on OrderHed equal to the sales reps email address and from there everything works. My problem is our orders can have anywhere from 1-4 reps on them, and if I try to set another variable for the 2nd item in the SalesRepList, and there isn’t one, I get the ‘IndexOutOfRangeException’ error. Any suggestions on how to evaluate if the value is there before trying to set the variable?

I also considered setting a variable or BPMContext to the number of entries in SalesRepList and using that as a condition, but was unable to get it working.

When starting the BPM set an integer variable to:
ttOrderHedRow.SalesRepList.Split(’~’).Count()
The number returned should be the number of Sales Reps assigned to the Order.
So you can then evaluate that variable to determine if you should attempt to lookup the email address.

1 Like

Works perfectly. Thanks!