web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Suggested Answer

Data Exchange Definition - code unit for Payment Export that uses Header, Body and Detail lines

(7) ShareShare
ReportReport
Posted on by 139
Hi experts,
 
I am configuring a data exchange definition for a payment export file (for BSP bank).  I was able to set a Line Definition of "DETAILS" (Detail type) with the required column definitions.  These columns are then mapped to the required payment journal fields.  But the Header and Footer Line Definitions require different line code names of "HEADER" and "FOOTER".
 
For the export to work, I need to add the "Pmt. Export Line Definition" to the payment method - I added "DETAILS".  The payment export generated a file with only the detailed payment lines (body).  The HEADER and FOOTER lines were not included.
 
Did I use the incorrect codeunit for the Payment Export?  I could only find 1271, 1276, and 1272.
 
Thank you
Peter
I have the same question (0)
  • Suggested answer
    Teagen Boll Profile Picture
    3,214 Super User 2026 Season 1 on at
    Hi Peter,
     
    I think this is a duplicate but you can see my comment on your other post here: Data Exchange Definition for Payment Export - tables for export HEADER and FOOTER
     
    That should give you a good starting point.
     
    Thank you,
    Teagen Boll
    Social: LinkedIn
  • Suggested answer
    YUN ZHU Profile Picture
    101,995 Super User 2026 Season 1 on at
    Hi, As far as I know, you don't need to specify codeunit; you can refer to the documentation below for the settings.
     
    Thanks
    ZHU
  • ploo Profile Picture
    139 on at
     
    Thanks again for your reply here.
     
    This post is about the codeunit used to export all Line Definitions - Detail, Header, and Footer.
     
    I've defined these 3 line definitions (at least the Detail line is correctly mapped but still looking for the table to map the Header and Footer, so I used Constant values to simulate the export).
     
     
    When I run "Bank=>Export", the output file only has the Detail line (records).  The header and footer are missing.
    According to the documentation, I need to specify the Pmt. Export File Definition for the Payment Method.  But in this field, I can only select one definition (Detail - not all 3 line definitions).
     
     
    This is preventing the export of all 3 Line Definitions.  But if I remove the DETAIL export line definition from the Payment Method, an error occurs when running "Bank Export" from the Payment Journal.
     
    Did I use the incorrect codeunit when defining this Data Exchange Definition?
     
    Thanks
    Peter
  • Suggested answer
    OussamaSabbouh Profile Picture
    17,681 Super User 2026 Season 1 on at
    Hello Peter,
    The issue is not really which of those codeunits you picked; it is how the standard payment export line definition works. On the Payment Method, BC points to one Pmt. Export Line Definition, and Microsoft’s setup says this is the line definition code used for that payment type, so when you select DETAILS, BC exports the detail/payment lines only. The Header Lines / Header Tag / Footer Tag fields in Data Exchange Definitions are mainly import-related, not a way to generate export header/footer records. For a bank file that needs separate HEADER / DETAILS / FOOTER physical records, the standard Data Exchange setup usually needs either a format that already supports that structure, an XMLport/report/codeunit customization, or a post-processing step that adds the header/footer. So I would not expect simply adding HEADER and FOOTER line definitions to automatically print them in the payment export file.
    Regards,
    Oussama Sabbouh
  • ploo Profile Picture
    139 on at
    Hi @Oussama Sabbouh, thank you for your feedback.  It confirms that customisation may be needed since the codeunit in W1 environment is unavailable.
  • Gerardo Rentería García Profile Picture
    27,280 Most Valuable Professional on at
  • ploo Profile Picture
    139 on at
     
    Thanks for the video link.  Those were the steps I used to create the Payment Export file.
     
    The key issue here is that the standard payment export can only use one Line Definition (as listed in the Payment Method used)
     
     
    Even after mapping Line Definitions for HEADER and FOOTER, these lines do not appear in the exported file.
     
    As mentioned by @Oussama Sabbouh, the standard export codeunit does not export Header and Footer line definitions - a custom codeunit needs to be created.
     
    Thanks
    Peter
  • Suggested answer
    Grigorios Mavrogeorgis Profile Picture
    2,544 Super User 2026 Season 1 on at
    Hi Peter, the issue is not really the codeunit, more about how the Data Exchange Definition handles multiple line types. The "Pmt. Export Line Definition" field on the payment method only points to one line definition (your DETAILS one), but for header and footer to come out in the file you need them defined as separate Line Definitions inside the same Data Exch. Def., with Line Type set to Header and Footer.

    How exactly they get written depends on the export codeunit you are using — some loop through all line definitions in order, others handle it differently, so worth checking the codeunit logic on your version before assuming. Same for 1220 vs 1276, I would verify which one fits your file format on your tenant rather than picking blindly.

    But first thing I would check is that HEADER and FOOTER Line Definitions exist on the Data Exch. Def. with the correct Line Type and their column definitions filled in. Usually this is where the file comes out with only details, like in your case.
  • ploo Profile Picture
    139 on at
     
    Thank you for your insights on this issue.
    My client is in PNG, and the bank doesn't support IBAN numbers required by the codeunit 1276.  
     
    I have the 1220 export the DETAIL line definition spot-on.
    I have also defined the HEADER (mostly constant values except for date) and FOOTER (total sum and record count - which, during testing, I used constant values).
     
    When exporting, the codeunit 1220 only wrote the Detail lines to a fixed text file (as expected).
    It looks like we will need to customise a codeunit for export that will include HEADER and FOOTER line definitions, like the Australian ABA export version.  (This version doesn't use Line Definitions for Header and Footer but draws data directly from other tables)
     
    Thanks
    Peter

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,081 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 1,351 Super User 2026 Season 1

#3
Grigorios Mavrogeorgis Profile Picture

Grigorios Mavrogeorgis 1,168 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans