Skip to content

Dynamics 365 Business Central Journal XML

The XML format documented here is used for both the import and export of journals in Dynamics 365 Business Central.

We recommend that the ExternalId field be populated with the unique ID of the journals from the external system, Zynk uses this field to track journals already imported to prevent duplicates being created in Dynamics 365 Business Central.

Tasks

XML

Any fields not documented below are not supported with our imports / exports. Examples of where in the XML the fields should appear are shown in the samples below.

Sample journal file:

<?xml version="1.0" encoding="utf-8"?>
<Journals xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <Journal>
    <Id>c4903bdf-549e-ed11-988a-000d3a3885d3</Id>
    <ExternalId>137183</ExternalId>
    <ODataETag>W/"JzIwOzE2Mjk0ODc2MjYxODczNzg3NzA0MTswMDsn"</ODataETag>
    <Code>DEFAULT</Code>
    <DisplayName>Default Journal Batch</DisplayName>
    <LastModifiedDateTime>2023-01-27T15:12:08.15Z</LastModifiedDateTime>
    <BalancingAccountId>00000000-0000-0000-0000-000000000000</BalancingAccountId>
    <BalancingAccountNumber />
    <JournalLines>
      <JournalLine>
        <Id>be7b832c-559e-ed11-988a-000d3a3885d3</Id>
        <ODataETag>W/"JzIwOzE1ODUxNTMyNDg4MjM2NDM2NjcwMTswMDsn"</ODataETag>
        <JournalId>c4903bdf-549e-ed11-988a-000d3a3885d3</JournalId>
        <JournalDisplayName>DEFAULT</JournalDisplayName>
        <LineNumber>10000</LineNumber>
        <AccountType>G_x002F_L_x0020_Account</AccountType>
        <AccountId>f9b2e6b3-611d-ea11-bb2d-000d3a4884fc</AccountId>
        <AccountNumber>10100</AccountNumber>
        <Account>
          <Id>f9b2e6b3-611d-ea11-bb2d-000d3a4884fc</Id>
          <Number>10100</Number>
          <Blocked xsi:nil="true" />
          <LastModifiedDateTime xsi:nil="true" />
        </Account>
        <PostingDate>2021-12-31T00:00:00</PostingDate>
        <DocumentNumber />
        <ExternalDocumentNumber />
        <Amount>0</Amount>
        <Description />
        <Comment />
        <TaxCode />
        <BalanceAccountType>G_x002F_L_x0020_Account</BalanceAccountType>
        <BalancingAccountId>00000000-0000-0000-0000-000000000000</BalancingAccountId>
        <BalancingAccountNumber />
        <LastModifiedDateTime>2023-01-27T15:13:46.053Z</LastModifiedDateTime>
      </JournalLine>
    </JournalLines>
  </Journal>
</Journals>

In each of the following sections most of the XML has been omitted to make the samples easier to read. The whole structure of the Journals schema is used below as a reference of where fields should be in the object model.

The following information can be found in the journal header.

Dynamics Field XML Field  Type  Input  Notes
- Id Guid Optional Used for matching existing journals
- ExternalId string Optional Stored in Zynk's internal DB and used for matching existing journals
Batch Name Code string Optional Used for matching existing journals.
- ODataETag string Optional Specify the last value to prevent updates if the record has been modified externally.
Description DisplayName string Optional
Bal. Account No. BalancingAccountId Guid Optional
Bal. Account No. BalancingAccountNumber string Optional Performs a lookup for the account based on number
Last Date Modified LastModifiedDateTime DateTime Read-only
<?xml version="1.0" encoding="utf-8"?>
<Journals xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <Journal>
    <Id>c4903bdf-549e-ed11-988a-000d3a3885d3</Id>
    <ExternalId>137183</ExternalId>
    <Code>TESTBATCH</Code>
    <ODataETag>W/"JzQ0OzhlSVVDejVkenJVTXBpYjZJeHFYSXR6aWNKd1RHUlE2bHVDdzZsSDZ2Mnc9MTswMDsn"</ODataETag>
    <DisplayName>Test Journal Batch</DisplayName>
    <BalancingAccountId>fdb2e6b3-611d-ea11-bb2d-000d3a4884fc</BalancingAccountId>
    <BalancingAccountNumber>10250</BalancingAccountNumber>
    <LastModifiedDateTime>2020-03-17T11:44:48.12Z</LastModifiedDateTime>
  </Journal>
</Journals>

Lines

The following information can be found in the journal lines.

Dynamics Field XML Field  Type  Input  Notes
- Id Guid Optional Used for matching existing journal lines
- ExternalId string Optional Stored in Zynk's internal DB and used for matching existing journal lines
- Line Number int Optional Used for matching existing journal lines.
- ODataETag string Optional Specify the last value to prevent updates if the record has been modified externally.
- JournalDisplayName string Read-only
- AccountType string Read-only
Account No. AccountId Guid Optional
Account No. AccountNumber string Optional Performs a lookup for the account based on number
Account No. Account/Id Guid Optional Alternative method of specifying the account ID
Account No. Account/Number string Optional Performs a lookup for the account based on number
Posting Date PostingDate DateTime Optional
Document No. DocumentNumber string Optional
- ExternalDocumentNumber string Optional
Debit/Credit Amount Amount decimal Required Positive amounts will debit the account, negative amounts will credit
Description Description string Optional
- Comment string Optional
Last Date Modified LastModifiedDateTime DateTime Read-only
<?xml version="1.0" encoding="utf-8"?>
<Journals xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <Journal>
    <JournalLines>
      <JournalLine>
        <Id>197029af-4468-ea11-a813-000d3a86f9a1</Id>
        <ExternalId>137183-1</ExternalId>
        <LineNumber>10002</LineNumber>
        <ODataETag>W/"JzQ0O3hNV1VOT2Z2a3lTRStGMnk2cngrVUNXbkFyaEJ5cjd3V0Ric0VMVzhoZG89MTswMDsn"</ODataETag>
        <JournalDisplayName>TESTBATCH</JournalDisplayName>
        <AccountType>G/L Account</AccountType>
        <AccountId>f9b2e6b3-611d-ea11-bb2d-000d3a4884fc</AccountId>
        <AccountNumber>10100</AccountNumber>
        <Account>
          <Id>f9b2e6b3-611d-ea11-bb2d-000d3a4884fc</Id>
          <Number>10100</Number>
        </Account>
        <PostingDate>2020-03-17T00:00:00</PostingDate>
        <DocumentNumber>1234</DocumentNumber>
        <ExternalDocumentNumber />
        <Amount>50</Amount>
        <Description>Employee expense</Description>
        <Comment>Fuel</Comment>
        <LastModifiedDateTime>2020-03-17T11:44:48.477Z</LastModifiedDateTime>
      </JournalLine>
    </JournalLines>
  </Journal>
</Journals>