Hi,
My XML-file contains an unspecified number of orders, and I’m using an XMLport to import orders from the file to my receiving table. Orders comes with an unspecified number of lines, and the lines include an element containing a product description. It’s likely that that the product descriptions contains large texts (e.g. 1000 - 4000 characters).
When the XMLport encounters product description element containing that many characters, it fails generating no error message.
Actually I don’t need the product description, and would rather skip this element, but I need suggestions on how to bypass it.
The following has been tried:
1. Element Properties:
Sourcetype = Text
TextType = Text
VariableName =Temp_Description
Code on the trigger: Product - Import::OnBeforeInsertRecord()
Temp_Description := ‘’;
2. Element Properties:
Sourcetype = Text
TextType = BigText
The above makes the port fail. That is, the XMLport import the orders until it encounter a product description containing a large number of characters.
Any suggestions please?
Regards
Christian
0
Answers
1) Import through XMLDOM instead XMLPort
2) Use transformation to remove the elements before importing by xmlport. See examples how to remove namespaces, you can remove specific element in same way, just creating different transformation...
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
Actually, setting the element properties to
SourceType = Text,
TextType = BigText,
VariableName = MyVariable
makes the xmlport run through elements containing large texts. After all I need the contents (or part of) of the element, and was able to retrieve this by [RetLength] := BigText.GETSUBTEXT(Variable, Position [,Length]), found in help.
Thanks for responding
Christian