xml - Loop to get all Line details which have one Header

Rathi
Member Posts: 51
Hi all,
I have one item with Header and many line items.
I want to export to xml.
I need to use header as root in .xml because there is a possibility whereby no line item at all.
When i export out the data, only one header together with one line item can be exported.
I want to do loop to get all details.
I just need an idea. please help.
I have one item with Header and many line items.
I want to export to xml.
I need to use header as root in .xml because there is a possibility whereby no line item at all.
When i export out the data, only one header together with one line item can be exported.
I want to do loop to get all details.
I just need an idea. please help.
0
Best Answer
-
it doesnot work since i want to import both table data into one column.
So i tried to create new table and insert all data into new table and export
it thru xml.
My xml report should like like this
-<GPOTender>
<Generic_Code>G0003</Generic_Code>
<Generic_Name>BioCon</Generic_Name>
<Prefer_Pack_Size>10 X 10</Prefer_Pack_Size>
<Prefer_Pack_Type>BOX</Prefer_Pack_Type>
<Country>SG</Country>
<Able_to_Quote>Yes</Able_to_Quote>
<Item_Category/>
<Item_No>FP-112-234</Item_No>
<Internal_Reference/>
<Description>Metanone</Description>
<BUOM>BOX</BUOM>
<Registration_No/>
<Shelf_Life/>
<Stability_Data>BE study/or clinical studies</Stability_Data>
<Batch_Size/>
<Lot_Size>0</Lot_Size>
<Formula>Different</Formula>
<Packing_Size/>
<Packaging_Type/>
<Remarks>Formula - MPE</Remarks>
</GPOTender>
5
Answers
-
please check MaxOccurs property of the lines is not set to Once..you can add message in Export::OnAfterGetRecord trigger of lines to check whether all lines are repeating or not..0
-
The property i set to unbounded. But the result still same.
I got add the count message the onafterrecord field.
it shows correct reading. but when export its print out one item line only.
******************************************************************
GPOTenderLine.SETCURRENTKEY(GPOTenderLine."Generic Code");
GPOTenderLine.SETRANGE(GPOTenderLine."Generic Code","GPO Tender".Code);
I := GPOTenderLine.COUNT;
MESSAGE(FORMAT(I)); // shows 3,1,2,3..etc
IF GPOTenderLine.FIND('-') THEN
REPEAT
Item_No := GPOTenderLine."Item No";
Internal_Reference := GPOTenderLine."Internal Reference" ;
Description := GPOTenderLine.Description ;
BUOM := GPOTenderLine.BUOM ;
Registration_No := GPOTenderLine."Registration No." ;
UNTIL GPOTenderLine.NEXT = 0;
Anything wrong with this code?0 -
and how does your xmlport looklike?
didn't you add lines as dataitem in xmlport and link between header and lines?0 -
look at standard xmlports like 9000
check properties LinkTable and Link fields0 -
it doesnot work since i want to import both table data into one column.
So i tried to create new table and insert all data into new table and export
it thru xml.
My xml report should like like this
-<GPOTender>
<Generic_Code>G0003</Generic_Code>
<Generic_Name>BioCon</Generic_Name>
<Prefer_Pack_Size>10 X 10</Prefer_Pack_Size>
<Prefer_Pack_Type>BOX</Prefer_Pack_Type>
<Country>SG</Country>
<Able_to_Quote>Yes</Able_to_Quote>
<Item_Category/>
<Item_No>FP-112-234</Item_No>
<Internal_Reference/>
<Description>Metanone</Description>
<BUOM>BOX</BUOM>
<Registration_No/>
<Shelf_Life/>
<Stability_Data>BE study/or clinical studies</Stability_Data>
<Batch_Size/>
<Lot_Size>0</Lot_Size>
<Formula>Different</Formula>
<Packing_Size/>
<Packaging_Type/>
<Remarks>Formula - MPE</Remarks>
</GPOTender>
5
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