PO XML Port

olwinolwin Member Posts: 22
Hi there,

I want to Export and Import Purchase Order Data using XML Port. But I found a problem when I want to export-import (exim) for more than one PO Data. The problem is when I see the XML file on IE

("The XML page cannot be displayed

Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later.



Only one top level element is allowed in an XML document. Error processing resource 'file:///C:/PO_XML_OK1.xml'. Line 271,...")

And when I tried to import this XML, an error message occurs from NAV 4.0 SP3 (The XML Parser return the following fatal error: A document must contain exactly one root element. Line number = 271 Column number =13)

Does anybody knows how to correct this error? (This Error didn't occur if I only export 1 PO file, in this scenario I want to export 2 PO files)

Thanks b4......

Comments

  • ara3nara3n Member Posts: 9,256
    Hello. A Valid XML file can have only one root.

    My guess you xml file looks like this
    <No>                      Table     Purchase Header
       <Buy-from Vendor No.>   field   PurchaseHeader::Buy-from Vendor No.
    


    You need to change the xml port to something like this.

    <PurchaseOrders>  text      PurchaseOrders
       <No>                      Table     Purchase Header
          <Buy-from Vendor No.>   field   PurchaseHeader::Buy-from Vendor No.
    

    Basically create a new node on top and indent everything else below it.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • olwinolwin Member Posts: 22
    Hi...
    I've tried your suggestion and it works.... :D Thank you so much.... I still have one problem with the Imported Data. I found that value on Order Date and Document Date field wasn't copied from the original data. Value on these 2 fields were populated with the current imported company work date. Can you kindly help me to solve this issue?
    Ilustration:
    Export Company: Import Company:
    WorkDate: 01/25/01
    Work Date: 01/28/01
    Posting Date: 10/10/01
    Posting Date: 10/10/01
    Order Date: 10/10/01
    Order Date: 01/28/01
    Document Date: 10/10/01
    Document Date: 01/28/01

    Thanks....
  • jlandeenjlandeen Member Posts: 524
    One thing is to check the validation order of the date fields. I don't know how you've built your Import Export routine but you may want to simply assign the values to the document fields instead of validating them.
    Jeff Landeen - Sr. Consultant
    Epimatic Corp.

    http://www.epimatic.com
  • rajaninairrajaninair Member Posts: 3
    hi everyone
    even m too having the same error wen i am trying to run the xml file i get the following error:
    The XML page cannot be displayed
    Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later.



    Missing equals sign between attribute and attribute value. Error processing resource 'file:///C:/Users/rajani.nair/Desktop/...

    <Res. Ledger Entry/Chq Printing>
    ^
    wat do i do plzzz help
Sign In or Register to comment.