Dynamics 365 Business Central – A closer look at Journals and Documents

Introduction

Ever wondered why you have options to post to Vendors in a Sales Journal and Customers in a Purchase Journal? What do Documents and Journals have in common? How are Ledger entries and GL register created?

In this post I’ll explain more about Financial Journals and Documents and hopefully unlock some of their secrets along the way.

**Please note there are other journals such as Item Journals for inventory management which I wont cover in this post)

Journals

Journals are scattered throughout Dynamics 365 Business Central and can be used to record a whole manner of transactions. The most commonly used financial journals would be General Journals, Sales Journals, Purchase Journals, Cash Receipt Journals and Payment Journals.

Interestingly, under the hood all the journals are pretty much the same. All the journal pages are based on the Gen. Journal Line (81) table and all journals use the same Gen. Journal posting routine (codeunit) to create the relevant Ledger Entries and G/L Register.

As you can see from the image below although the General Journal and Sales Journal use different pages they are based on the same table.

The difference between the journals only really exists on their Pages and the actions and options available on those Pages.

For example the Payment Journal page has an action to run the “Suggested Payment Routine”, which is relevant to paying suppliers, and the other journals also have different actions. However, as they are all technically the same, nothing stops me creating a Payables Payment transaction in a Sales Journal and getting the correct Ledger Entries.

For instance, as you can see below although I’m in a Sales Journal I can still choose an Account Type of “Vendor”.

When you post the journal the relevant Ledger Entries and G/L Register are created and the journal lines are removed. (some exceptions exist like for recurring journals).

Therefore, taking all this into consideration, we could technically just use the “General Journal” page to record all of our financial transactions in Business Central, whether they be Sales or Purchase entries. We can also use one journal to record a whole host of different types of transaction. (as I show in this post)

Documents – Overview

When we refer to documents in Dynamics 365 Business Central we are referring to things like Sales Invoices and Purchase Invoices. (there are of course others such as Sales Orders, Sales Shipments, Purchase Orders, and Purchase Receipts)

They will have a Header and Lines, with the Header typically containing information on the Customer or Supplier and various dates, and the lines containing information or what you are selling or buying, for example items or GL codes.

When you post an Invoice, postings routines are ran to create the Ledger Entries and G/L Registers and new Posted Documents are created and the unposted document is removed. (you can archive Sales Orders using the archiving options in Setup)

For example if I were to Post a Sales Order via the “Ship and Invoice” option a Posted Sales Shipment and Posted Sales Invoice would be created along with financial Ledger Entries such as General Ledger and Customer Ledger Entries.

Documents – Posting

So what do Documents and Journals have in common? What makes them technically the same when it comes to the creation of the Ledger Entries and GL Registers?

As mentioned above when you post a Document the system runs posting routines to create the relevant ledger entries and it turns out these are the exact same posting routines that run when you are posting a journal (whether that be a General Journal, Payment Journal etc).

The posting routine responsible for this is “Codeunit 12, Gen. Jnl.-Post Line”. This is responsible for creating all the Financial Ledger Entries and G/L Register regardless of whether you are posting a journal or a document.

Therefore when you post a document its converted into journal lines, the lines then validated, and finally its posted in the same way as a journal.

Conclusion

The Gen. Journal Line table and Gen. Jnl.-Post Line codeunit do feel like the heart of Dynamics 365 Business Central. (certainly the financial heart)

I hope this article helped explain some of the concepts around journals that I found confusing when I started out with Business Central.

Thanks for reading!

Dynamics 365 Business Central – How troubleshooting the error “Amount must be positive in Gen. Journal Line Journal…” took me on a journey of discovery with Journals

Introduction

I had a user report the error “Amount must be positive in Gen. Journal Line Journal Template Name=’PURCHASES’…..” when posting a Purchase Journal and although the solution is straight forward (the error is telling us the problem) it started a fascinating learning journey into the world of journals in Business Central.

The Beginning – The Error

To confirm the error in full I’ve provided a screen shot below:

A journal line similar to the one being entered, which was causing the error is below. (its a purchase invoice for £100.00)

The simple fix here is to change the “Amount” column to a positive value but why do we have to do that?

The Middle – A Deep dive

If we step back and take a closer look at the journal line we are trying to post we can see the following:

  1. The journal line has a “Document Type” of “Invoice”
  2. The “Account Type” is “G/L Account”
  3. The “Amount” is a negative value.
  4. The Balancing Account Type is “Vendor”.

So, based on this information what are we telling the system to post?

As the “Amount” is negative we are asking the system to “Credit” the G/L expense code, and as the balancing entry is “Vendor” we are asking the system to debit payables and create a positive “Vendor Ledger Entry”. However, if we think about things, this isn’t the expected entries for a Purchase Invoice. For an purchase invoice you’d expect to Debit the G\L Expense code, Credit the “Vendor” and create a negative “Vendor Ledger Entry”. Therefore when we attempt to post the above transaction Business Central produces the error:

Amount must be positive in Gen. Journal Line Journal…..

In essence the error is saying:

“In order to post a Document Type of Invoice for this Purchase Journal Template you need to Debit the G/L Code 30100. Therefore the Amount should be Positive”

So, what happens if we post the same journal line but the opposite way around? What happens if we leave the “Document Type” of “Invoice” but select “Account Type” of “Vendor” first, leave the “Amount” as a negative value, and have the “G/L Account” as the balancing entry like this:

When I attempt to post this it works fine, even though the “Amount” is still negative?

This is because I’m now asking the system to Credit the Vendor (and create a negative “Vendor Ledger Entry”) and Debit the G/L Account 30100 which are valid entries for a document type of “Invoice”.

Penny dropped! I now understand how the journals are working!

The End – More Fun with Journals

Taking this further, have you ever wondered how you can post a Sales Invoice from a Purchase Journal? (or just about any transaction from any Journal) Well if we apply the logic above we can see how this will work just fine.

Take this Sales Invoice I’ve entered in the Purchase Journal page as an example:

Here I’ve selected a “Document Type” of “Invoice” and an “Account Type” of “Customer” and my Bal. Account Type is my G/L revenue code. I’ve then entered a positive number in the “Amount” column. (as this is a Purchase Journal the “Amount” had defaulted to a negative value after choosing “Invoice”) If I post this journal line the system will Debit my receivables, create a positive “Customer Ledger Entry” and the balancing G/L code will be credited. It will therefore work just fine.

The Extras – Lets get a bit technical

How is all this working? Every Page in Dynamics 365 Business Central is based on a table. If you run the “Page Inspector” on the Journal pages you can see they are all based on the “Gen. Journal Line (81)” table. (just press CTRL+ALT+F1 on any page to see the Page Inspector)

This is essentially why we can perform the same actions in all the different Journal pages. For example we can post a Sales Invoice in Purchase Journal or even more bizarre post a Sales Invoice in a Payment Journal. (try it…trust me it works!)

The only difference is that some pages, like the Payment Journal page, have specific actions related to paying vendors like the “Suggested Payments” action.

Cool, eh!

Conclusion

I must admit this some of this information might be obvious to a seasoned Dynamics NAV or Dynamics 365 Business Central professional however coming from a Dynamics GP background this was a really important learning experience for me.

Now I’ve grasped these concepts I’m much more comfortable working with journals.

Thanks for reading!