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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

Composite Entity for external application's XML message

(0) ShareShare
ReportReport
Posted on by 925

Hello, 

I am preparing an integration with an external application based on the XML files (one direction, import only) and I thought that it will be possible to use the Data Management and Composite Entity, but now I have doubts about it. 

First thing is that the XML structure is not always the same, some tags are optional and if they are empty the XML is generated without them. So <CustomerRef> can exist, but there can be files without it. I found THIS topic where Martin explained that the tag must be in the file once it is in the mapping. Anything changed in that kind of case or I have to prepare an XSLT file to transform the file before the import?

The second question is about handling the "empty" sections like in the example below. The <Lines> section has no value itself, it only contains multiple <Line> elements. What is the best practice to handle that case? I could create the "Lines" entity with only the "SalesNumber" field related to the parent's element value, but then it will want me to map this field in the source file (where it doesn't exist) and I don't want that at it should be populated based on the relation. But it will require having at least one field mapped, so I could create another field with mapping to the default value. So it is getting messy.

Should I still try to get this working using the Composite Entities, should I prepare a custom import function for this or there is any other option to recommend? 

I have no impact on how the generated files look like and they won't be changed/adjusted by the vendor. 

Thank you in advance. 

<?xml version="1.0" encoding="utf-8"?>
  <Document>
    <SalesOrder>  
      <SalesNumber>SO-0001</SalesNumber>
      <SalesDetails>
        <OrderType>Journal</OrderType>
        <CustomerRef>Note</CustomerRef>
      </SalesDetails>
      <Lines>
        <Line>
          <LineNum>1</LineNum>
          <PackDetails>
            <Weight>10</Weight>
          </PackDetails>
        </Line>
      <Line>
        <LineNum>2</LineNum>
        <PackDetails>
          <Weight>10</Weight>
        </PackDetails>
      </Line>
    </Lines>
  </SalesOrder>
</Document>

I have the same question (0)
  • Verified answer
    nmaenpaa Profile Picture
    101,166 Moderator on at

    Composite entity would be just the right tool for you.

    However it is correct that if your mapping includes CustomerRef field, then all the import files must contain it, either with a value or without a value. So the sending system must create the files like this, or your integration platform / middleman must add it if it's missing.

    The child entities must have fields that point to the parent entity. Also those can be populated by the integration platform, or you can also use xslt transform in the inbound data project in D365 to transform the file.

    Having to adjust the file between the source and target systems is very common in integrations, so you definetely should not abandon composite entities and develop everything from scratch because of it.

  • Verified answer
    Martin Dráb Profile Picture
    239,031 Most Valuable Professional on at

    I would indeed use a transformation from the format given to you to the format needed in F&O.

    Throwing away Data Management and developing something custom sounds a bit extreme to me in this case

  • axk Profile Picture
    925 on at

    This is the answer I was looking for, thank you Nikolaos. The whole message is quite big, but I will try to transform this message properly.

    Edit: Thank you Martin for your feedback. I will try to handle this case with Data Management.  

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 659

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 465 Super User 2026 Season 1

#3
Syed Haris Shah Profile Picture

Syed Haris Shah 304 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans