For future people looking into this.... it is not possible without a customization in the W1 localization to include the header and foot lines in the payment export file. This has been confirmed by Microsoft support. See below response from Microsoft.
Thank you for sharing the details regarding the export of header and detail lines in your Data Exchange Definition for payment journal exports.
Based on the description, and please correct me if I am wrong, I understand that:
- You are working within the Dynamics 365 Business Central W1 localization.
- You have configured a Data Exchange Definition that includes both a Header and Detail line definition.
- When exporting the payment journal file, only the detail lines are generated in the exported file.
- Despite attempting multiple configuration changes within the Data Exchange Definition, the header line does not appear in the exported output.
- You have shared screenshots showing the current setup and the resulting export file which does not contain the expected header record.
You are looking to have the header line exported along with the payment journal detail lines, correct?
I sincerely apologize for the inconvenience this has caused, and rest assured we are here to assist you.
After reviewing the standard behavior of Business Central in this area, I would like to set the right expectation. When exporting data from the Payment Journal using standard functionality, Business Central generates only the detail (record) lines. Header and footer line types, even if defined in the Data Exchange Definition, are not included in the exported output by design.
If your business requirement is to include a header line in the exported file, this would require customization. Typically, this involves extending the export logic to explicitly write the header once and then append the journal detail lines accordingly. You can learn more about this from this document.