Hello,
I am inexperienced with XML import/export and NAV. I have created a basic import and basic export using XMLPorts in the past, but nothing 'fancy.'
We are in the process of absorbing another division into NAV (previously running Oracle). They have a number of customer facing websites that we need to unplug from Oracle and connect to NAV. This means I have to mimic the XML files Oracle was previously outputting to provide content for these websites.
I don't know which approach to take, XMLPort (which seems limited but more WYSIWYG) or XMLDom (which I have never used).
I ultimately need to create XML structure as follows:
<Product_Info>
<Company>
<Company_ID>
<Category>
<Category_ID>
<Sub_Category>
<Sub_Category_ID>
<Product_Family>
<Family_ID>
<Product>
<Product_SKU>
</Product>
</Family_ID>
</Product_Family>
</Sub_Category>
</Category>
</Company>
</Product_Info>
I will have recorda that will look like something like this:
Item|Company ID|Category ID|Sub-Category ID|Family
ABC|J011|240|020|KD2020
DEF|J011|240|020|KD2020
GHI|J011|240|030|LM0010
JKL|J011|240|030|LM0010
MNO|J011|300|150|JL4849
I'm not sure how I would use an XMLPort to output all the J011 records, indenting for each change in Category ID, Sub-Category, and Family. This makes me think I have to manually code out all of the elements. Am I right in this assumption, or can it be done with XMLPorts? I am using 5.0 executables on a 3.7b codebase. Any tips?
kind of fell into this...
Comments
In general I like to describe XML Ports as really a special case of dataports. They work in a similar fashion allow you to encode data much easier (as you don't have to worry about field and record seperators) and also applying cardinality rules.
It might help for you to use some temporary in memory record sets to group and sort the elements that you're exporting in a similar hierarchy to your example.
Epimatic Corp.
http://www.epimatic.com
EDIT:
I'm actually nearly done with the XML DOM approach. I have successfully created data in the required structure!
There's some more details on XML Ports
http://msdn.microsoft.com/en-us/library/dd338846.aspx although it doesn't appear to get into too much detail about any really advanced XML Port stuff
Epimatic Corp.
http://www.epimatic.com