I'm calling an XMLPort from a codeunit and I want to catch cases where the XMLPort fails because of a badly formed file, a condition I haven't forseen, etc.
So I have this:
IF NOT XML_Port.IMPORT THEN BEGIN
ErrorText := GETLASTERRORTEXT;
The trouble is, ErrorText (returned by GETLASTERRORTEXT) is always empty, even in cases where a straight call to the XMLPort (no IF at the front) produces a proper NAV error message on the screen.
Has anyone got a suggestion why I can't get the error text properly?
Thanks in advance.