Personalized Community is here!
Quickly customize your community to find the content you seek.
Choose your path Increase your proficiency with the Dynamics 365 applications that you already use and learn more about the apps that interest you. Up your game with a learning path tailored to today's Dynamics 365 masterminds and designed to prepare you for industry-recognized Microsoft certifications.
Visit Microsoft Learn
2020 Release Wave 2Discover the latest updates and new features to Dynamics 365 planned through March 2021.
Release overview guides and videos Release Plan | Preview 2020 Release Wave 2 TimelineWatch the 2020 Release Wave 1 virtual launch event
Ace your Dynamics 365 deployment with packaged services delivered by expert consultants. | Explore service offerings
Connect with the ISV success team on the latest roadmap, developer tool for AppSource certification, and ISV community engagements | ISV self-service portal
The FastTrack program is designed to help you accelerate your Dynamics 365 deployment with confidence.
FastTrack Program | Finance TechTalks | Customer Engagement TechTalks | Upcoming TechTalks
I am importing a project from AX9 to AX3 and now I have to modify a class that I created for XML exporting.
xmlRecordList = xmlDoc.createElement2(#RecordList, #journal);
xmlSubject = xmlDoc.createElement2(#Subject, #journal);
xmlRecords = xmlDoc.createElement2(#Records, #journal);
This is a part of the code from AX9 that I wrote, but there is no "createElement2()" method in AX3 how can I get a similar result?
my XML has to look like this:
Any idea how to get that last attribute in without it duplicating in other tags?
How did you export the data from AX 2009? Can't you simply put everything to the default namespace? You wouldn't have this problem at all.
In AX9 I used createElement2 method as I have already mentioned, but in AX3 there is no such method. What do you mean by "put everything to the default namespace"?
If it means that you export data from AX 2009 by your own code just to be able to import it to Axapta 3.0, why do complicate everything for yourself by settings namespaces like xmlns:kls="urn:x..."? (If you're not aware of it, xmlns stands for XML NameSpace.) If you omit that, you'll still have all the data and your code on both sides will be simpler.
If you have a reason for it, you forgot to mention it.
sorry I might have explained it badly I made a project in AX9 for clients and they will need to export XML files and then send those files to a webservice. Some clients that also are in need of that function have AX3 installed so I had to import my project (with this class), but in AX3 the class xmlDocument does not have the method createElement2. Which is why I am struggling in remaking my code in AX3
Aha, I've got it now. You have working code in AX 2009 and you tried to use the same code in Axapta 3.0, but it doesn't work because XmlDocument class there doesn't have createElement2() method. Now you're looking for another way how to create an element with a specific namespace URI.
Unfortunately I haven't seen Axapta 3.0 for so many years that I don't remember methods available in its version of XmlDocument class. I assume that setting namespace is possible, because it's a very important thing, but I can't provide any details.
You could also use .NET XmlDocument class directly, but it's not very easy in Axapta 3.0. .NET Interop was introduced only in Dynamics AX 4.0; it would have been easier if they upgraded AX in past twelve years.
Another (ugly) option would be composing XML as text by yourself.
Ok got it, well i will try to search for it again, maybe i will find something simillar and update this post.
Thank you for the advice!
In AX 3.0 XmlDocument has a createElement() method with only one parameter. Maybe you need try to create you own class extended from XmlDocument class in AX 3.0 with all necessary methods from AX 2009?
Business Applications communities