If you have the Adv Print Routing, you can make a Report Style with Break Routing, for the invoice, and call that report from your DD
If you want (or need to do it all in the BPM), you can set the variable using the “Set Argument/Variable” widget with the following code:
Db.Customer.Where( r =>r.Company == callContextClient.CurrentCompany && r.CustNum == ttInvcHeadRow.CustNum).Select( r =>r.EMailAddress).DefaultIfEmpty("").FirstOrDefault()
Need more details than that?
-
Create a variable in the BPM
-
Add a Set Argument/Variable widget
-
Select the variable you created in step 1, and for the expression, enter the code above
-
Add a Condition widget to check the value of the variable. If it is not equal to
""
-
In the Email widget, use the Insert -> Scalar Variables to select your variable.
-
It will now use the value of the variable (which should contain the email address field from the customer)