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

RathiRathi 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.

Best Answer

Answers

  • mohana_cse06mohana_cse06 Member Posts: 5,504
    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..
  • RathiRathi Member Posts: 51
    edited 2016-11-02
    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?
  • mohana_cse06mohana_cse06 Member Posts: 5,504
    and how does your xmlport looklike?
    didn't you add lines as dataitem in xmlport and link between header and lines?
  • RathiRathi Member Posts: 51
    Sorry, i've no idea on how to link between two tables ?
    Could you assist me?
    nav.png 21.1K
  • mohana_cse06mohana_cse06 Member Posts: 5,504
    look at standard xmlports like 9000
    check properties LinkTable and Link fields
Sign In or Register to comment.