Hello to all,
I am trying to export a set item records based on a filter to an xmlport using the following code
IF EXISTS('C:\Xml_Item.xml') THEN
ERASE('C:\Xml_Item.xml');
TestFile.CREATE('C:\Xml_Item.xml');
TestFile.CREATEOUTSTREAM(TestStream);
gRecItem.SETRANGE(gRecItem.ToSync, TRUE);
IF gRecItem.FINDSET THEN;
lXmlItemSyncEVCprova.SETTABLEVIEW(gRecItem);
lXmlItemSyncEVCprova.SETDESTINATION(TestStream);
lXmlItemSyncEVCprova.EXPORT;
TestFile.CLOSE;
but only the first record of the filter recordset is exported.
Must the xmlport have some kind of particular characteristic?
Or is my code wrong?
Thank you for your time
0
Comments
It must have only one root element, you must "nest" the records into this root element.
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
My xmlport is formed by a root element (Text type) then I have the item table nested underneath and then all the item table fields nested underneath this last one like shown below. Note my last element is a Text field named RealPrimaryKey, i need it for my purposes.
ItemSync Element Text <ItemSync>
Item Element Table Item(Item)
No. Element Field Item::No.
No._2 Element Field Item::No. 2
.
.
.
RealPrimaryKey Element Text <RealPrimaryKey>
So I think that the xmlport structure is correct.
Tell me if I'm wrong
Thanks alot
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
but I still have the same problem it exports only the first rec of the recordset..
any other suggestions?
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n