Returns the text that was contained in the last error message that was displayed.
String := GETLASTERRORTEXT
Property Value/Return Value
The text string that was contained in the last error message that was displayed by Microsoft Dynamics NAV.
The string cannot exceed the maximum string length specified in Microsoft Dynamics NAV. This is currently 1024.
If no error has occurred, the function returns an empty string.
You can set up Microsoft Dynamics NAV so that it keeps running even if a run-time error occurs. You can use this function to determine whether an error has occurred and to see the actual text in the last error message that was generated. You can also use the CLEARLASTERROR function to remove the last error message from memory. If you then call GETLASTERRORTEXT, an empty string is returned.