Notifications
Announcements
No record found.
Hi all I have to write some code to create an xml. I did that but it looks completely different. How do I have to write the code to get the following result:
*This post is locked for comments
Hi ChrisR75,
What code do you have already ?
I wrote some code to generate a xml but the structure looks different.
As far as I understand, you want to use attributes, to create one you can use xmlElement.setAttribute() method, here is an example how to use it axzaptech.wordpress.com/.../create-xml-and-write-to-file-in-dynamics-ax
Have you written the code in AX X++, or in Visual Studio and use it as a .Net reference class library?
There are a lot of examples out there on how to do this in C#, I would recommend going down that route:
msdn.microsoft.com/.../ms256237%28v=vs.110%29.aspx
stackoverflow.com/.../xelement-adds-an-xmlns
Hi it is not really like the Attributes because there you have the value enclosed by "" but not the xml they want to have. there you have the type <string> </string> beside the value
Please, be more specific, it's not clear what you need from us.
My guess it that you simply called .xml() method on a table buffer and you don't understand at all how to generate XML with element names defined by yourself. Is my guess correct? If so, let's talk about the XmlDocument class...
You can add Tag <Field> with attribute FieldName that has a value "Person" then add child tag <String> with value 1005 and so on.
hi Martin
no first I used the XmlWriter class with the method WriteAttributeString and than it looked like this:
Okay, let's stop guessing. Please show us your code (generating XML) and explain what's the problem you need help with.
Also try asking some questions, instead of just showing a piece of XML code.
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.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Martin Dráb 4 Most Valuable Professional
Priya_K 4
MyDynamicsNAV 2