Use Acumatica

Using Conditional Logic on Acumatica Business Forms

Modifying Acumatica Business Forms

Once you begin using the Acumatica Business Forms like Invoices, Credit Memos and checks, you may identify opportunities for slight modifications. For example, you may want to use conditional logic within the Acumatica Business Forms. Conditional logic makes life easier. With conditional logic, you embed your intentions into the forms and minimize manual changes.

Here we’ll show two examples of adding conditional logic to Acumatica Business Forms.

Example 1: Conditionally show a field based on Acumatica Branch

This example concerns the Invoice form. For a certain branch (Branch02), we want to be able to see the field “Document Description” on the Invoice. For that Branch02, the Document Description field is  used to hold customer information specific to that branch. For the other branches, showing the Document Description field was unnecessary.

In Acumatica, the Document Description field is stored on the Invoice header:

Acumatica Business Forms Invoice Doc Desc

Here’s how you can accomplish that in Acumatica.

First, open Report Designer, open your form, and follow proper backup procedure.

Next, identify where on the form you want to see the Document Description field. Drag the ARInvoice.DocDesc field to the form:

Acumatica Business Forms DocDesc

Now, you’ll add your conditional logic to the field. Toggle from “Fields” to “Properties.” Click the ellipsis (…) next to the “Value” field.

Acumatica Business Forms Conditional Logic

This opens an editor. In this editor, Acumatica helpfully supplies a few syntax examples for operators and functions. You will use the function under “Program Shortcuts” dealing with If/Then conditional statements.

The syntax provided is: IIf( expr, truePart, falsePart )

You’ll modify this to be specific to your condition: =IIf([BAccount.AcctCD] = ‘BRANCH02′, [ARInvoice.DocDesc], ‘’)

This function translates to “If the BAccount.AcctCD is “Branch02″, then show the value for ARInvoice.DocDesc. Otherwise, just show nothing.”

Now you have conditional logic on your form that only prints the Document Description value for Branch02.

Example 2: Conditionally show a document total as negative

This example also concerns the Invoice Form. The same form is used for both Invoices and Credit Memos. In this case, we are using AP automation with Avid Xchange. The request is to show the Document total as a negative number if the Document Type is a Credit Memo. This ensures that the AP Automation in place will handle credit memos as expected from an accounting point of view.

In this case, you’ll follow the same first few steps:

First, open Report Designer, open your form, and follow proper backup procedure.

Next, identify the field that should have the conditional logic. In our case the important fields are all in the Totals area:

Acumatica Business Forms Inv Totals

Since the fields pre-exist, we just need to add conditional logic to them. Select the field. Open the ellipsis (…) next to “Value” to open the expression editor.

Here we follow the same If/Then syntax, but in both cases we display the document total (instead of showing a blank value as demonstrated above).

The function here, for the “Totals” field, is: =IIf([ARInvoice.DocType] = ‘CRM’, -[ARInvoice.CuryOrigDocAmt], [ARInvoice.CuryOrigDocAmt])

Note that “CRM” stands for “Credit Memo” and is held within the Acumatica database.

This translates to, “If the ARInvoice.DocType is “Credit Memo”, then show the ARInvoice.CuryOrigDocAmt as a negative. Otherwise just show the value for ARInvoice.CuryOrigDocAmt.”

As long as you are properly backing up your forms, and deploying changes in a test company before moving to live, you should feel comfortable making and testing changes to the Acumatica Business Forms.

What else are you doing that uses conditional logic?