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

Notifications

Announcements

No record found.

Community site session details

Community site session details

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

XML File Creation

(0) ShareShare
ReportReport
Posted on by 106

Hi,  I need to create an XML File, I am following

https://diveshboramsdnavblog.wordpress.com/2018/03/09/vs-code-xml-dom-management-part-2/

I am able to create a simple format as mentioned, but in the requirement, I have child elements under every node. Like Attachment, Can someone suggest how can I achieve this in Business Central Cloud?

Thanks,

<Header>
      <Body>
         <Body1>
             <Body2>
             <Body2>
         <Body1>
      <Body>

      <Body4>
         <Body5>
             <Body6>
             <Body6>
         <Body5>
      <Body4>

<Header>

XMLFILE.JPG

I have the same question (0)
  • Suggested answer
    JAngle Profile Picture
    133 on at

    What about using a data exchange definition so you can setup the header and detail elements. Your codeunit could then loop through the definition to produce the required XML

    An appsource extension follows this type of logic. Granted it is for imports though: appsource.microsoft.com/.../pubid.alna_business|aid.alna_document_import|pappid.488c52d8-62aa-492a-a7cd-e257d0e6c1f3

  • Suggested answer
    Suresh Kulla Profile Picture
    50,243 Super User 2025 Season 2 on at

    Check the codeunit 10145 it has several functions and examples which deal with Xml document.

  • Techworld Profile Picture
    106 on at

    Thanks, I donot find this Codeunit in BC online French. However XML Dom Managemt is there but it has some functions marked as ONprem WHICH can be helpful but not able to use them

  • Techworld Profile Picture
    106 on at

    Thanks, I wanted to use that but as it is a invoice fight which has conditional values to be generated at runtime. not able to do this, it has to find unique Items invoiced in a period and also customer for whom invoice was done.

    So was not possible with that setup

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,468

#2
YUN ZHU Profile Picture

YUN ZHU 923 Super User 2025 Season 2

#3
Sumit Singh Profile Picture

Sumit Singh 607

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans