Import XM File

goolnarrgoolnarr Member Posts: 5
Hi,
I have the following xml file which I need to import.
<POSTE>
<ID>001</ID>
<DETAILS>PPPPP</DETAILS>
<DETAILS>P3</DETAILS>
<DETAILS>P1</DETAILS>
</POSTE>

I have created the xmlport and imported the file. I have assigned Details element as unbounded. However, only the last value for DETAILS get saved in my table. Is there a way to loop through the DETAILS elements and concatenate them and save them under only one field?
Your help will be greatly appreciated.

Comments

  • SavatageSavatage Member Posts: 7,142
    Does Your table have a "Line No." field?
  • kinekine Member Posts: 12,562
    How you are saving the value into the table? How the xmlport looks like?
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • goolnarrgoolnarr Member Posts: 5
    Hi,
    the format for the xmlport is:
    POSTE
    link to a table
    --ID
    to an ID field on the table
    --DETAILS
    to DETAILS field on the table
  • kinekine Member Posts: 12,562
    It will save the record after the POSTE element is processed, thus saving only the last DETAILS value... you need to insert it manually through code...
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • goolnarrgoolnarr Member Posts: 5
    Can you provide me with a sample code on how to do this? I have been struggling with this but to no avail.
    Thanks a lot
  • goolnarrgoolnarr Member Posts: 5
    Can anyone please guide me as to how i can loop through the xml elements and get its value.?I tried using the events in the xmlport but to to avail. Please help.
  • ShedmanShedman Member Posts: 194
    Save the values in a variable and put the variable in the record in the OnBeforeInstertRecord trigger.
Sign In or Register to comment.