Exploring Auto-Journals: What is the “1=2” Formula?

By: | Category: ERP

This week we highlight Auto-Journals in Sage X3 exploring the “1=2” formula by one of our favorite Sage experts, Pam Nightingale. This is Pam’s last blog for Sage – she retired in March – the Sage X3 team of Net at Work wishes Pam the very best in her well-deserved retirement.

sage X3

Before we look at the “1=2” formula, here are Pam’s past blogposts exploring automatic journals:

This seventh exploration will explore what is behind the “1=2” formula.

Remember exploring is better done in our Test environment to avoid accidentally changing or deleing data.

Our journey starts in Automatic journals (GESGAU) under Setup > Financials > Accounting interface.

Where might we find “1=2” in our auto journal?

We find the formula in the Condition section of an auto journal line. Hopefully, you’ll only find it in a custom auto journal indicated with its code starting with “Y” or “Z.” This is the preferred or standard operating procedure for naming and creating customizations.

Let’s first talk about the Condition section (GADFORCND) under the journal lines. Here is what the Online Help tells us:

This is one of three logical conditions relating to the values of the fields of the principal table, as well as the general table if it is a line of linked table type (this includes, if necessary, constants and functions). If these conditions exist, they must be verified for the line to be generated. In the case of the setup of a repetitive type line, these conditions can use the Index variable.

The conditions differ depending to the type of line:

  • Linked table: use the values of the principal and general tables. If these conditions exist, they must be verified for the line to be generated.
  • Repetitive: use the index value in the conditions.

If this condition, expressed in the form of a logical expression, is false, then the entry is not generated

Why would you use this always false formula “1=2” in the conditions?

The last line of the Online Help extract explains what we have with the formula “1=2.”  Every line in the condition must be true for the line to be generated. With the false statement in the condition, the auto journal line will not generate a journal entry line.  We’ve seen this used when the customer didn’t want transactions to flow through the Received not Invoiced process. Or, they made modifications by adding additional lines to the auto journal instead of changing the existing lines.

For an auto journal line to be used all conditions must be met.  In this example, we will look at a stock auto journal line. The VCRNUMREG (journal adjustment) field in the STOJOU table can’t be blank.  The ACCDETSTK (Anglo-saxon stock accounting) parameter must not be equal 2 for the financial site in the FINRSPFCY field of the STOJOU table. The VARVAL (movement variance) field for the STOJOU table can’t be equal to 0. However, all that doesn’t matter because “1=2” isn’t true. This line would be skipped.

Hopefully this satisfied your curiosity about the mysterious “1=2” formula.

If you have any questions about auto-journals in Sage X3, or any other Sage X3 questions, please contact us.