web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics NAV (Archived)

XMLPORT NAV 2013 R2 - ERROR WHEN THERE IS A SAME NODE NAME

(0) ShareShare
ReportReport
Posted on by

Hi.

An error occurs when we execute IMPORT in XMLPORT. It happens on IMPORT.

We have to create NodeNames with the same name. ( we need to get oficial xml files from legals and they have multiple nodenames with the same name).

Node Name                                           Node Type            Source Type           Data Source
Price                                                        Element                  Text                        <Price>
    UnitPrice                                             Element                  Text                        <UnitPrice>
        PriceDiscount                                  Element                  Text                          PriceDiscount1
            DiscountNumber                        Element                  Text                           DiscountNumber1
            DiscountTaxValue                       Element                  Text                           DiscountTaxValue1
        PriceDiscount                                  Element                  Text                           PriceDiscount2
            DiscountNumber                        Element                  Text                           DiscountNumber2
            DiscountTaxValue                       Element                  Text                          DiscountTaxValue2
        PriceDiscount                                  Element                  Text                          PriceDiscount3
            DiscountNumber                         Element                 Text                          DiscountNumber3
            DiscountTaxValue                        Element                 Text                          DiscountTaxValue3

The error is Multiple definition of element PriceDiscount causes the contente model to be ambíguos...

Tks.

XMLPORT-_2D00_-error-for-multiple-definition-of-elements-_2D00_-NAV-2013-R2.png

*This post is locked for comments

I have the same question (0)
  • Alex A Profile Picture
    2,898 on at

    It appears that whatever system you're using to create the xml export may be creating duplicate nodes. You may need to clean up your legacy system data before doing the export. There are online xml file validators that you can use to determine if the xml export file being produced is valid. You may have to modify this xml file manually if there aren't that many nodes to fix.

  • Community Member Profile Picture
    on at

    Hi Alex

    We can't modify the xml data.

    There is a main reason: theses files are integrated in the EDI process, so it's not possible to do that manually.

    Another way to see this situation is a solution base on using namespace control.

    But in Dynamics NAV 2013 R2 we cannot see how to do that.

    Just like we look it in www, some of our friends use namespace to define a diferente name for these cases.

    Do you have any idea why we can't change properties for namespace in xmlport in NAV 2013... ?

    Thanks anyway.

  • Suggested answer
    keoma Profile Picture
    32,729 on at

    please publish a xml data sample as you need it for analyzing, so that one could better find a solution for you.

    xmlports are not the only method do create/read xml files. you can also create it by code using cu 6224.

    for that follow moxie4nav.wordpress.com/.../extend-cu-6224-read-xml-node-values-and-attributes

  • Community Member Profile Picture
    on at

    Hi

    Here they are.

    These files are examples of some EDI files that we received from Distribution companies as their SalesOrder.

    We cannot change it, or ask them EDI-Dynamics-Community.zipto change, because they are standard for all country.

    Just like you can see, our problem is on lines PriceDiscount; these likes are more then one and they give them the same tag name.

    In our work, when we use EXPORT, we can create more than one tag with the same name, without any process error; OUR PROBLEM IS ONLY IMPORT.

    Thanks for all your help.

  • Suggested answer
    keoma Profile Picture
    32,729 on at

    what you need is a structured import.

    in your case base node would be Price, source type table, data source Price, where Price is a (new ?) table. UnitPrice is then a field in that table. PriceDiscount is a (new ?) sub table, which is linked to Price using properties LinkTable and LinkFields of node PriceDiscount.  

    <Price>
    <UnitPrice>0.868</UnitPrice>
    <PriceDiscount>
    <DiscountNumber>1</DiscountNumber>
    <DiscountTaxValue>0.00</DiscountTaxValue>
    </PriceDiscount>
    <PriceDiscount>
    <DiscountNumber>2</DiscountNumber>
    <DiscountTaxValue>0.00</DiscountTaxValue>
    </PriceDiscount>
    <PriceDiscount>
    <DiscountNumber>3</DiscountNumber>
    <DiscountTaxValue>0.00</DiscountTaxValue>
    </PriceDiscount>
    </Price>

    This is the same thing with e.g. Sales Header and Sales Line, a typical scenario when importing/exporting sales orders. For that i developed a little sample to show what i mean. 

    xmlport_2D00_1.png

    With that xmlport i imported a sales order containing 3 sales lines without any problem .

    the according xml import file:

    <SalesHeader>
    <DocType>1</DocType>
    <DocNo>101006</DocNo>
    <CustNo>30000</CustNo>
    <DocDate>2016-01-14</DocDate>
    <SalesLine>
    <DocType>1</DocType>
    <DocNo>101006</DocNo>
    <CustNo>30000</CustNo>
    <LineNo>10000</LineNo>
    <Type>2</Type>
    <No>1920-S</No>
    </SalesLine>
    <SalesLine>
    <DocType>1</DocType>
    <DocNo>101006</DocNo>
    <CustNo>30000</CustNo>
    <LineNo>20000</LineNo>
    <Type>2</Type>
    <No>1000</No>
    </SalesLine>
    <SalesLine>
    <DocType>1</DocType>
    <DocNo>101006</DocNo>
    <CustNo>30000</CustNo>
    <LineNo>30000</LineNo>
    <Type>2</Type>
    <No>1001</No>
    </SalesLine>
    </SalesHeader>

  • keoma Profile Picture
    32,729 on at

    is your issue solved? if yes, please give feedback and verify.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics NAV (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans