Codeunit 52101152
This codeunit is responsible for XML import.
ReadHeader()
In this function, all header fields are read and passed on to the sales header.
The return value 'bRet' determines whether the header could be correctly validated. The figure below shows a code excerpt which determines whether the vendor could be found.
If the vendor of the XML file is not found, then the import is void.
OpenXMLFile()
This function first reads the header and then the line items.
The boolean value 'bRet' determines whether or not there is an error. For example, a check is made to determine whether the article numberhas been filled in. If the article number is empty, the Quantity field cannot be saved. The quantity is written in the description and the import is rejected.
Additional XML file fields must be programmed here, similar to the existing examples. The figure below shows an example of reading the quantity and saving in local variables.
The quantity is then validated. The validation sequence is important for the new fields. For example, a quantity cannot be validated if the article number has not been validated.