BPM ABL Question


I am new with ABL so please forgive me if I am missing something basic here.

I am attempting to create a BPM that pops up a warning box on on the order entry screen if there are open credit memos on the user account. Below is the code so far, but I am having trouble referencing the InvcHead table using fields not declared in the “find first” statement.

I suspect that I am doing something out of order. Any help would be greatly appreciated.

InvcHead.OpenInvoice = 1

Instead you should should be looking for a true or false

InvcHead.OpenInvoice = true

Your warning box is more of a notification box as it won’t stop the records from updating, but the syntax looks right if that’s what you’re going for! Keep in mind though that some characters will cause errors in the code if included within the InfoMsg (I believe commas are one example). Also, here’s one example if you want to include a field value in the message as well:

{lib\PublishInfoMsg.i &InfoMsg = “'The MtlPartNum field value is: ’ + PartMtl.MtlPartNum”}.

Thanks Dan and Kevin, both of your comments were helpful.

I think the overall intent of my BPM is to create a notice if there is a credit on the account. My IF statement, does not connect to a specific invoice. I am trying to create the info message if there is a credit memo on the account. I believe I need to have a BAQ that will sum the open invoices. I mocked up the query using SQL. Is it possible to write a query to aggergate the InvoiceHed data inside of the BPM?

I wrote the above in t-sql. I assume the same could be done with a BAQ.

I assume an invoice goes from Open to Not Open when cash receipts are applied against it.

What causes a credit memo to become Not Open?

Hi Calvin,

I am doing a search for open credit memo. The CM will be open if it hasn’t been applied to a invoice. Goal here is for the sales team to be notified in sales order entry that there are open credit memos for a customer. They can thusly check and apply a credit memo before charging a credit card.

Just brainstorming here, so any (or all) of the following may not apply (or be flat out wrong) …

If a CM is entered without an invoice referenced, it’s considered open (InvHead.OpenInvoice is true). What sets the OpenInvoice field to false - when it’s applied to an order during order entry?

Just trying to figure out when you know the CM has been “used”.

When it is applied to other invoices.

Mark W.

I realized I hadn’t understood the goal of the OP, so I deleted the above post that went in a completely wrong direction.

Back on track … I don’t think you need any custom code at all

The BPM should be simply have the condition:

Number of rows in the Query is not less than 1

With the query containing:

ttOrderHed.Company = InvcHead.Company 
AND ttOrderHed.CustNum = InvcHead.CustNum
AND InvcHead.CreditMemo = true
AND InvcHead.OpenInvoice = true

Instead of looking for invoices with a balance of less than 0

An additional test for InvcHead.OrderNumber = 0 would check to make sure the CM isn’t already applied to an invoice, and is just waiting to be posted.

Hi Calvin, yes. I think you are correct. That makes sense.

I am not sure if I am interpreting the BPM condition in your instructions correctly. See below.

I’ve never used E9 (we jumped straight from V8 to E10), So I don’t know exactly how BPM’s are made in E9. But I don’t think you need any custom code to do what you want. At least not until you want to make it fancier.

Back in V8, the “Designer” consisted of a table/list of condition(s) (the when to execute the actions), and another table/list of action(s) to take when the condition is met. And you had the option to use custom code for either.

To do what you want in V8, I’d just use one of the condition templates - the one highlighted below (the pict below is from E10, but I assume they’re pretty close)


In E10 you graphically create the query. I forget how it was done in V8.

And the “Show a Message” (or “Raise an Exception” if you want the transaction to not complete) as the action.

1 Like

Dear Calvin,

You suggestion worked as advertised!!!

Thank you so much for your help. I was unaware of the query functionality which was built right into the system without ABL. Great stuff.


1 Like

In your ABL coding, you can do one of these.

{lib/PublishEx.i &ExMsg = ‘“Message text”’}

If you are on the latest release of 9.05.7 then you can also use this:

{lib/PublishInfoMsg.i &InfoMsg = “‘Message text’” &InfoSeverity = {&MESSAGE_INFO}}

You can change the message type by changing the severity
&InfoSeverity = {&MESSAGE_INFO}
&InfoSeverity = {&MESSAGE_WARN}
&InfoSeverity = {&MESSAGE_ERR}
&InfoSeverity = {&message_UpdateConflict}

1 Like

Thanks everyone for your help.

Calvin, your suggestion is up and running in the live environment.