RecordLink into an XMLPort

Hi all,

 

I have published a function as a WS that given an Item No. and an URL, y create a record link into the item card.

Now, i must publish a function that receives a purchase order no, an returns and XMLPort like this:

 

<PO>

<Item>

<link1><link2><...>

<Item>

</PO>

 

A node for eachr item in the purchase order, and inside it, another node for each link into the item card.

The function that add the link into the item is this:

  procedure AddLink_toItem(pItemNo: Code[20]; pUrl: Text; pDescription: Text[250])
    var
        lRecordLink: Record "Record Link";
        lItem: Record Item;
    begin
        lItem.Reset();
        if lItem.get(pItemNo) then begin
            lRecordLink.Init();
            lRecordLink."Record ID" := lItem.RecordId;
            lRecordLink.SystemId := lItem.SystemId;
            lRecordLink.URL1 := pUrl;
            lRecordLink.Created := CreateDateTime(Today, Time);
            lRecordLink.Company := CompanyName;
            lRecordLink.Description := pDescription;
            lRecordLink.Insert(true);
        end;
    end;

But I don't finde the way to relate the recordLink with the item into the XMLPort...

 

Any hint?

 

Thnak you all!

Related
Recommended