Export more than 1 record in an xmlport

victor73
Member Posts: 55
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
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
-
All depends on how your XMLPort looks like...
It must have only one root element, you must "nest" the records into this root element.0 -
Thanks for your answer.
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 alot0 -
It should work. Check the element property MaxOccurs - it must be <unbounded>.0
-
I checke the property and it was set to Once then I set it to <unbounded>,
but I still have the same problem it exports only the first rec of the recordset..
any other suggestions?0 -
Have you set it on the table element or somewhere else?0
-
Only on the element one based on your suggestion, but note that all the other fields under the element have that property set to <once> as default and I think that is right.0
-
is the table data element set to temporary? Also is it unbounded?0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions