I create xml port for item table. containing fields No, Description.
When I export this xmlport it export only 1st item.
Why it is not exporting all items?
To export all items What I have to do?
Please suggest any soln..
You need to have correct XMLPort structure and you need to pass more records to the XMLPort and not just one (e.g. using SETRECFILTER or filtering to one No....)
Structure must be something like:
Items
Item
No
Description
Item
No
Description
Item
No
Description
...
Do u mean that if there are 10 items in item tables then I have to design xml port as
Item
No
Description
Item
No
Description
Item
No
Description
...
10 times?
If I add this 10 times then it shows me 1st value 10 times not all 10 items.
If I write
ifile.CREATE('C:\myxml.xml');
ifile.CREATEOUTSTREAM(ostream);
IF Item.FIND('-') THEN
BEGIN
REPEAT
XMLPORT.EXPORT(50001,ostream);
UNTIL Item.NEXT=0;
END;
ifile.CLOSE;
MESSAGE('export complited');
Then also it shows me 1st value 10 times but not all 10 items.
What must be the problem?[/code]
Do u mean that if there are 10 items in item tables then I have to design xml port as
Item
No
Description
Item
No
Description
Item
No
Description
...
10 times?
If I add this 10 times then it shows me 1st value 10 times not all 10 items.
Of course NO! Just once. If set correctly, XMLPort will loop through all passed records and will repeat the tags for them.
If I write
ifile.CREATE('C:\myxml.xml');
ifile.CREATEOUTSTREAM(ostream);
IF Item.FIND('-') THEN
BEGIN
REPEAT
XMLPORT.EXPORT(50001,ostream);
UNTIL Item.NEXT=0;
END;
ifile.CLOSE;
MESSAGE('export complited');
Then also it shows me 1st value 10 times but not all 10 items.
What must be the problem?[/code]
Check the "MaxOccurs" property on the Table tag. There must be Unbound and not Once...
Answers
Structure must be something like:
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
Item
No
Description
Item
No
Description
Item
No
Description
...
10 times?
If I add this 10 times then it shows me 1st value 10 times not all 10 items.
If I write
Then also it shows me 1st value 10 times but not all 10 items.
What must be the problem?[/code]
Check the "MaxOccurs" property on the Table tag. There must be Unbound and not Once...
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
Thanks Kine
Its working fine. \:D/ :whistle:
I am Devi .
I am trying to export some data from purchase header table(38),but it is showing me only 1 item when i exported.
This is the first time i am trying with xmlport.
Can anyone guide/tell me how to do ?
Pls it is of little urgent.
thanks and Regards,
Devi.
Try this u also..