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.
Thanks
Debbie
0
Answers
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)
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);
Blog - rockwithnav.wordpress.com/
Twitter - https://twitter.com/RockwithNav
Facebook - https://facebook.com/rockwithnav/
Debbie
http://forum.mibuso.com/discussion/66253/xmlport-2009-how-to-insert-sales-line-description-lines-from-xml-file-lines?new=1
Debbie