How to import xml file into table using xml port

Hi All,

I have a xml file and that have to import into table using xml port . I have designed xml port and call this by codeunit. so it is working fine and i dint get any error but when i seen into table then there only last line inserted.

my xml file is looking like this

<?xml version="1.0" encoding="UTF-8"?>

<invoice_export xmlns:xsi="">www.w3.org/…/XMLSchema-instance" xsi:noNamespaceSchemaLocation=“quantum_invoicedata_export.xsd”>



<medication_id>85546</medication_id>
false


<medication_id>85547</medication_id>
false


<medication_id>85548</medication_id>
false


<medication_id>85549</medication_id>
false


<medication_id>85563</medication_id>
true


<order_number>793154</order_number>
5
<is_batch>true</is_batch>

<last_name>Doe</last_name>
<first_name>John</first_name>
<patient_uid>654654</patient_uid>

CD2
Epirubicin 50mg in 250ml NaCl 0.9% i.v.
<route_uid>IVB</route_uid>
<prescribed_drugs>


Epirubicin
456684


50
mg



NaCl 0.9%
12541



</prescribed_drugs>


Glucose 5%
12573



</invoice_export>

you can see there are four records but it is inserted only one.

Please advice me[:|]

Thanks

Avinash

It’s a bit difficult to say whats wrong when we don’t know the code you’re using and which version of NAV?

Have you tried with the debugger?

Hi Erik,

Thanks for your reply.

I am using Navision 2013

Can you guide me all procedure with code so i could import this file.

i am trying to my level best, but at the last it is importing only last line into table.

Thanks,

Avinash

No I cannot give you all procedure with code! Unless you want to pay for for doing this! [;)] That would take me a lot of time and would require that I have access to the database.

But I can suggest that you try to run the import with the Debugger open and see exactly what goes wrong. Is it only reading the last line or is actually reading the other lines and just overwriting with the other lines? I have see this many times.

Thanks Erik,

I am trying with debugger.