E10 BPM Beginner

New to BPMs in E10, seems like this should be easily do-able but am not sure what the next step is. I’m using a data directive to fire upon an invoice posting. Then I have a query that checks the Customer table for an email address (not stored anywhere in the InvcHead table). If it exists I want to capture it to use it for email routing. How do I store the value from the Customer table (which is not a temp table) to use in the next Email action?

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?

  1. Create a variable in the BPM

  2. Add a Set Argument/Variable widget

  3. Select the variable you created in step 1, and for the expression, enter the code above

  4. Add a Condition widget to check the value of the variable. If it is not equal to ""

  5. In the Email widget, use the Insert -> Scalar Variables to select your variable.

  6. It will now use the value of the variable (which should contain the email address field from the customer)

1 Like

Thank you! I will try this. Yes, this is exactly what I am trying to do, capture the customer email to use within APR.

If you have APR, you might already have the customers email in the ARForm RDD. I know it is in the OrderAck RDD.

So you might be able to have your DD BPM do an autoprint (regardless of the customer email being present or not), and the Break/Routing style could determine if it exists.

1 Like

Thanks, and yes this is a great idea. I am using APR to auto route if an email exists and print otherwise. EDI is my biggest issue at this point, primary bc I’m just not that familiar with E10 BPM logic. I need to capture the Order Entry person for each invoice upon posting b/c if it is the “EDI” user (we auto import with this user id) and the customer has an 810 on their account then auto print of the EDI txt file report style should fire. Otherwise invoices route to the regular PDF style. I’ve tried several different methods to capture the EntryPerson and they are all failing. EDI is the constant thorn in my side.

There’s other field that might be useful


Indicates Entry method program that used to create the order.
S = Standard, Q = Quick Entry, C = Counter Sales, D = Demand/EDI


Order created from EDI interfaced module.


Updated from EDI module if 855 or 865 created.


Defines if this document is marked as EDI Ready


A counter of the number of times an AR Invoice has been transmitted via EDI. The counter is automatically incremented each time the EDIReady flag changes from False to True.

We also do EDI invoices. EDI text files are created when the invoice group is posted. For this purpose we use a Data Directive on two fields on the table InvcHead as under:

The last two conditions are used by us to avoid sending Internal Use documents. You may not need them. It has been working fine all these years.

Vinay Kamboj

Yes, we have ours set up similarly as well currently. Our issue is that we have some customers that order by phone or email sometimes even though they are set up for EDI. In these cases we need to send them a non EDI invoice and they have an 810 on their account. This criteria sends invoices to all customers that have 810s on their accounts regardless of how the order came in so we have a lot of daily 810 failures. Thus we also need to be able to screen who the order was entered by to eliminate generating files for these “EDI” customers that aren’t sending orders via EDI.

For us once a customer is set up to take EDI invoices they will not accept any non EDI invoices, even if the order has not come through EDI.

Getting the order entry person will be an issue, since the order information is on the Invoice Line and the data directive is on the Invoice Head. This will be even more of an issue if an invoice covers more than one orders.

Vinay Kamboj

Do you use TIE Kinetix for EDI or another process? The way we are set up an EDI invoice can’t be generated for a non EDI order. We need a complete revamp of our process so I’m interested in potential other solutions. For invoicing we don’t have multiple orders on an invoice so that’s not an issue…

We have customers who sent EDI Orders and want only EDI Invoices. Also we have customer where we only do EDI Invoices. These customers send orders by phone, fax, email but will only take EDI invoices. So, once a customer is set up for EDI invoices no matter how we got the order, we have to send invoices by EDI or else we do not get paid.

We do not use TIE Kinetix. It was too expensive. We use a third party VAN from a company called Commport. You can look up their website and see it will work for you. It works through FTP, where they pick up the files generated in the specified folder. Also the orders are dropped in a folder the same way. We also sent order Acknowledgements and ASNs to some customers.


Vinay Kamboj

An In-Transaction InvcHead Data Directive similar to the following may help:

var vInvcHead = (from inv in ttInvcHead where((inv.RowMod == “A”) || (inv.RowMod == “U”)) select inv);

if (vInvcHead != null)
foreach (InvcHead inv in vInvcHead)
if (inv.EDIReady == true)
var vOrderHdr = (from o in Db.OrderHed where o.Company == inv.Company && o.PONum == inv.PONum select o).FirstOrDefault();

    if(vOrderHdr != null && vOrderHdr.EDIOrder != true)
      inv.EDIReady = false;


Welcome @PGirard - good post. Next time format code by placing a line with 3 ticks (graves), before and after the code. Like:


to get …

void foo(void){
   // do some stuff

Will do.

(First posts are always subject to improvements.)



1 Like