XMLPort inserting multiple levels to Sales Invoice where file has data missing on some lower levels

dsummer
Member Posts: 7
Creating an XMLPort to import Sales Invoice data from an external system.
Sales Header, Sales Lines are ok, but there is an additional level for details, which would normally be entered as text Description line below the relevant Sales Line.
The import file doesn't have details for that additional level for all the sales lines being imported, it only appears on some records.
With the 3 level (or possibly more) import files, how do you tell it to skip the checking for level 3, if there is no data for that level under one of the level 2 lines?
Currently my import is stopping with the error that the import file doesn't fit the schema.
Sales Header, Sales Lines are ok, but there is an additional level for details, which would normally be entered as text Description line below the relevant Sales Line.
The import file doesn't have details for that additional level for all the sales lines being imported, it only appears on some records.
With the 3 level (or possibly more) import files, how do you tell it to skip the checking for level 3, if there is no data for that level under one of the level 2 lines?
Currently my import is stopping with the error that the import file doesn't fit the schema.
Thanks
Debbie
Debbie
0
Best Answer
-
Hi,
You import file is XML? Set the base element for level 3 (or for all relevant elements, if more than one) to optional (i.e. property MinOccurs=Zero)
1
Answers
-
Hi,
You import file is XML? Set the base element for level 3 (or for all relevant elements, if more than one) to optional (i.e. property MinOccurs=Zero)
1 -
Hey dsummer,
First of all you need to make the same XML port as you are getting from the external system as NAV will exactly map with one to one relationship while doing the import process. Schema should always be static if you are using a common XMLPORT. Secondly if you have some Fields which ou have attached in the XMLPORT and they may come blank then you need to convert those Field as Text type instead of Fields and write Below code on the Import::OnAfterAssignField Trigger.
ItemstoShip TEXT
IF ItemstoShip = '' THEN
Table."Items to Ship" := 0
ELSE
EVALUATE(Table."Items to Ship",ItemstoShip);
Thanks
Blog - rockwithnav.wordpress.com/
Twitter - https://twitter.com/RockwithNav
Facebook - https://facebook.com/rockwithnav/0 -
Thank you. The MinOccurs=Zero is doing the trick.Thanks
Debbie0 -
I'm down to the final section in the import file, which is the Description lines at the bottom of the file to be inserted as extra lines in the Sales Document. The code behind the sections isn't being recognized. Are you able to help with this question too?
http://forum.mibuso.com/discussion/66253/xmlport-2009-how-to-insert-sales-line-description-lines-from-xml-file-lines?new=1Thanks
Debbie0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions