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 :
Microsoft Dynamics AX (Archived)

Generating a custom XML

(0) ShareShare
ReportReport
Posted on by

Hello everyone,

A noob question regarding the best method to generate a custom XML to send to a partner processor. Between our organizations we've agreed on a XML structure, on our side we've developed a sample XML generated from job code and lots of hardcoding but it does go against AX data and an AOT query. I would like to know if there's a much better method to creating this XML. I understand I probably have not provided much to go by. Basically, I'd like to have a combination of an AOT query and X++ code to create objects which I can pass to a "XML engine" to generate the file. I'll try to answer any questions posed. Thank you very much!

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Martin Dráb Profile Picture
    239,645 Most Valuable Professional on at

    What seems to fulfill your requirements are AIF document service with XSLT transformation. AIF document services are based on queries and X++ classes and deal with things like serialization, surrogate key replacement etc. for you, but you have little control on the structure of XML. But that's when XSLT comes into play - it allows you to (relatively) easily transform one XML to another one.

  • Suggested answer
    Community Member Profile Picture
    on at

    As Martin suggested AIF is the option to go for your requirement

    please review following link how to create AIF document Service

    1. Create the document query.

    2. Run the AIF Document Service Wizard.

    3. Add any custom business logic to the document class.

    4. Deploy the service for outbound exchange using File adapter.

    This will create the XML in specified folder of outbound port

    Please verify and update us if this helps you and let us know if you need any more technical support for this.

  • Community Member Profile Picture
    on at

    Martin / Nitesh, thank you both for your replies. I've only done some preliminary searches in an effort to find good resources on the topic, and I've looked over any links you've provided so far. Might be ask you both for recommendations on resources or primers which may help get me started (preferably with some starter examples)? Any direction would be greatly appreciated. Thank you again.

  • Martin Dráb Profile Picture
    239,645 Most Valuable Professional on at

    I can't tell you anything specific, unless you ask a specific question. You already have links to AX documentation; you can also buy a book about services in AX 2012.

  • Community Member Profile Picture
    on at

    Hi Martin,

    Fair enough for me. I will try to be as specific as I can with any follow up questions. Thank you for your patience.

  • Community Member Profile Picture
    on at

    Following links will help you with AIF code.

    Importing data using XML

    thinkinginax.blogspot.com/.../importing-sales-order-xml-using-x.html

    Exporting data using XML

    thinkinginax.blogspot.com/.../exporting-xml-salesorder-using-aif.html

  • Community Member Profile Picture
    on at

    Thank you Qureshi. The comments in the export link seems to indicate this would be a good option to develop some test data so I'm not sure how this would fit my needs. Certainly it's good information nonetheless. Thanks again.

  • Community Member Profile Picture
    on at

    Kindly mark as suggested answer if it fulfill your need

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!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
CP04-islander Profile Picture

CP04-islander 24

#2
Michel ROY Profile Picture

Michel ROY 14

#3
Jagadabi Profile Picture

Jagadabi 6

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans