Exploring auto journals: what is that “1=2” formula?

3 minute read time.

Time once again to take an exciting journey through the world of automatic journals. Here is where our six previous adventures took us:

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

But before we take the first step on our trek, remember exploring is better done in our Test environment. Although we are looking for excitement in our explorations, we don’t want to take the unnecessary risk of accidentally changing or deleing data. The thrilling discoveries are still there without the equivalent of “lions, and tigers and bears, oh my!” ie corrupting data.

Off to the land of Automatic Journals found by way of Setup to Financials to Accounting interface.  The locals also call it GESGAU.

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

We would 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? I was very curious about this strange formula.

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.  I’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.

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

This will be my last installment of the Exploring auto journals series. Today, Friday, March 29, 2024 is my retirement day from Sage.  I have written a good number of blogs over the years. Where did the topics come from? The blog ideas came from conversations with customers, partners, and colleagues. Sometimes, they came from my own curiosity about how a function or formula worked. I learned a lot as I researched my topics. I have been both flattered and gratified when you’ve told me on a support call that you’ve read my blogs. It has been my privilege to write for you. 

In closing…

Take care my X3 friends. Stay safe!