XML Import

brijleobrijleo Member Posts: 70
Hi All,

I hava a issue with respect to XML file import in NAV2009Sp1.
Here scanerio is that i have to import XML file into intermediate table using XML Port.
However when i run codeunit which is calling XML port it give me an error for the root element which is defined as text.as " Element is <navpinvoice> unexpected".

Please find the below XML file code.

<?xml version="1.0" encoding="utf-8"?>
<navpinvoice version="004">
<purchaseinvoiceheader>
<company>Test</company>
<pv_identifier>PI</pv_identifier>
<pv_invoiceno>Test001</pv_invoiceno>
<pv_invoice_date>07/04/2011</pv_invoice_date>
<pv_suinvoiceno>8111</pv_suinvoiceno>
<pv_suaccountno>2666
</pv_suaccountno>
<pv_currency>EURO</pv_currency>
<pv_exchange_rate>1.000</pv_exchange_rate>
<pv_nett_value>142.00</pv_nett_value>
<pv_vat_value>28.40</pv_vat_value>
<pv_total_value>170.40</pv_total_value>
</purchaseinvoiceheader>
<purchaseinvoiceline>
<pn_invoiceno>Test001</pn_invoiceno>
<pn_orderno>PO0001</pn_orderno>
<pn_vat_rate>20.00</pn_vat_rate>
<pn_unit_value>6.00</pn_unit_value>
<pn_qty>2.00</pn_qty>
<pn_nett_value>12.00</pn_nett_value>
<pn_vat_value>2.40</pn_vat_value>
<pn_total_value>14.40</pn_total_value>
<pn_ponett_value>12.00</pn_ponett_value>
<pn_povat_value>2.40</pn_povat_value>
<pn_pototal_value>14.40</pn_pototal_value>
<pn_variance_nett>0.00</pn_variance_nett>
</purchaseinvoiceline>
</navpinvoice>

Comments

  • jlandeenjlandeen Member Posts: 524
    Is the first element in your XML Port spelled exactly like: navpinvoice ?

    Also does that element have a property defined on it for version?
    Jeff Landeen - Sr. Consultant
    Epimatic Corp.

    http://www.epimatic.com
  • krikikriki Member, Moderator Posts: 9,110
    [Topic moved from 'NAV Three Tier' forum to 'NAV/Navision Classic Client' forum]
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


Sign In or Register to comment.