Integrating with financial management

Although it is not likely to make big changes in financial management, it might be necessary to create G/L Entries in a new posting routine.

In the previous chapter, we already pointed out briefly that during posting transactions in Microsoft Dynamics NAV, the actual journal line records are never really inserted in the database. They are used as temporary containers to hold the data during posting. Doing an actual INSERT would require defining a journal template name, journal batch name, and line no. and could cause locking in the database.

Let's create a new codeunit that will create a G/L transaction.

After creating the codeunit, we need to set up the two variables that are the minimum requirement to post something to the general ledger.

Creating a G/L transaction

The preceding screenshot shows two variables:

In Microsoft Dynamics NAV, there are many examples of how to integrate with financial management. The following is a list of interesting codeunits that create general journal lines:

Go ahead and have a look inside these codeunits to learn how Microsoft does the integration.