--- title: "Set up document - Ledger journal" slug: "set-up-document-ledger-journal" description: "Import data into ledger journals using D365 F&SCM with specific properties, automatic header creation, and efficient record processing." tags: ["Task topic"] updated: 2026-07-15T08:34:20Z published: 2026-07-15T08:34:20Z canonical: "docs.staedean.com/set-up-document-ledger-journal" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.staedean.com/llms.txt > Use this file to discover all available pages before exploring further. # Set up document - Ledger journal Use a **Ledger journal** document to import data into the ledger journals. Compared to the **D365 F&SCM** document, the **Ledger journal** document focuses only on the ledger journals. It has ledger-journal-specific properties and behavior. Based on the document type and journal name, the journal header is created automatically when the message is started, and the document is opened. So, in the document: - No records are required for the journal header. Also, no mapping is required in the related message. - Only set up records for the journal line tables. All lines in the same import message run are added to the created header. For the records, use tables that are related to the defined journal name. For example, the LedgerJournalTrans table. The journal name, as defined in the document header properties, defines which ledger journal is applicable. Examples of supported ledger journals are: - General journal - Invoice journal On journal creation, the voucher settings of the journal name are considered. If a transaction date is available, the voucher is set. ### Steps 1. Click **Connectivity** **studio - Integration Design**. 2. Click the **Documents** tab. 3. Click **New**. 4. Define a meaningful name for the document. **Example:** If the document is used for a sales integration, you can use names like 'Sales - Order' or 'Sales - Invoice'. In the **Document** field, type a value. > [!NOTE] > **Best practice** > > In the document name, do not use the: > > - Application name: Use the **Application** field to define the applicable application. > - Document type: Use the **Document type** field to define the applicable document type. 5. In the **Project** field, enter or select a value. 6. Define the applicable application for the document. For a **Ledger journal** document, for example, select a ‘D365 F&SCM’ application. In the **Application** field, enter or select a value. > [!NOTE] > **Note** > > You can only select an application that is defined for the applicable project. You can define project applications on the **Projects** page. 7. In the **Document types** field, select '**Ledger journal**'. 8. Sub-task: Set properties. 1. Expand the **Properties** section. 2. To improve performance when processing a lot of records, you can use paging. For paging, the records are split over several threads which run these records in parallel batch tasks. Define the number of records to be processed by one batch task. In the **Query page size** field, enter a number. > [!NOTE] > **Note** > > - You can use this calculation to define the number to be entered: Query page size = Total number of records / Number of available threads. > - Paging considers range filters set on child records. Incorrect page counts are avoided by supporting exists and non-exists logic. 3. Define the applicable paging method: - **Default**: The default method uses offset paging. Starts at the beginning and counts forward for each next page again. Walking past and skipping all previous records each time. This method gets slower as offset grows. **Example**: Page size=100, first 1,000 records are already paged. For the next page, records 1 - 1,000 are read and skipped, records 1,001 - 1,100 are returned. - **Modulo**: Used for large data sets of, for example, millions of records. All records are sorted into pages based on the record ID. This method results in more consistent query performance for large datasets. In the **Paging method** field, select an option. > [!NOTE] > Note > > The **Modulo paging** method only works if for the document the sorting field is defined and is of type Int64 or Integer. 4. On export, if you start the message run manually, you can have the standard D365 F&SCM query page shown before the message is run. You can use this query page to define more-detailed ranges. Select **Yes** in the **Prompt** field. > [!NOTE] > **Note** > > If the message is run in batch, the standard D365 F&SCM query page is not shown and an error is logged. 5. On import to D365 F&SCM, time validations can be applicable. By default, the time validation is applied. Which means, this field is set to **No**. As a result, each import of an instance to which time validation applies, results in a new instance. If this field is set to **Yes**, no time validation is applied, and the existing instance is updated. For example, on import of addresses, the effective period is validated. Select **Yes** in the **Disable time validation** field. 6. You can define the applicable journal name for each company in the ledger journal mapping. However, if no ledger journal mapping exists for a company, the default ledger journal name is applied. Enter the default ledger journal name that defines the desired journal type for the companies without a ledger journal mapping. Based on the document type and journal name, the journal header is created. In the Default ledger journal field, enter or select a value. > [!NOTE] > **Note** > > - You can only select journal names that are related to the ledger journal. > - If a ledger journal mapping exists for the current company, the applicable ledger journal name is shown in the Ledger journal field. 7. You can automatically post the journal when the import is finished. Select **Yes** in the **Post journals** field. > [!NOTE] > **Note** > > When testing the document and message, you are advised to set this field to **No**. So, you can review the imported data before the journal is posted. 9. Sub-task: Set custom handler. 1. Expand the **Custom** section. 2. For a **Ledger journal** document, several standard handler classes are available. You can use a customized handler class. To do so, extend a standard handler class. In the **Handler** field, enter or select a value. 10. Sub-task: Set advanced features. 1. Expand the **Advanced** section. 2. Select the desired query type: - **Standard**: To select the data, only one D365 F&SCM query is created for the document. - **Custom**: To select the data, a separate query is created for each document record. The **Custom query** feature offers an alternative approach to data retrieval. Unlike the standard query, with the **Custom query**, you can: - Join data across different companies. - Control queries more precisely with the **Group by** function. - Limit the selection to the first record only for complex queries. - Use fields from ancestor records in record relations. In the **Query type** field, select an option. > [!NOTE] > **Note** > > Try to use the standard query unless the standard query does not give the desired results. So, only use the custom query if required to get a specific query result. 11. Sub-task: Set up ledger journal mapping. 1. On the **Action Pane**, click **Design**. 2. Several companies can exist in your D365 F&SCM environment. Ledger journal names are defined per company and can be different per company. You can define the applicable ledger journal name for each company in the ledger journal mapping. Click **Ledger journal mapping**. > [!NOTE] > **Note** > > If no ledger journal mapping exists for a company, the default ledger journal name is applied. You can define the default ledger journal name on the document header. 3. Click **New**. 4. Enter the company for which you want to define the ledger journal name. In the **Company accounts ID** field, enter or select a value. 5. Enter the ledger journal name that defines the desired journal type for the company. Based on the document type and journal name, the journal header is created. In the **Ledger journal** field, enter or select a value. > [!NOTE] > **Note** > > You can only select journal names that are related to the ledger journal. 6. Close the page. 12. Close the page. > [!NOTE] > **Notes** > > For vendor invoices, you can import the details as well in the **VendInvoiceInfo** table. You can add this table to the document records. ## Related - [Customize document handler class](/customize-document-handler-class.md) - [Create separate files](/create-separate-files.md) - [Custom query for internal documents](/custom-query-for-internal-documents.md)