Is it possible to capture Windows error message in NAV?

chandrurecchandrurec Member Posts: 560
Hi all,

I am using a shell automation concept to upload/download a file from navision through coding.But when the user ID or password is not matching , then the system will throw some error message. Is it possible to capture this error message inside navision. If possible, kindly let me know how to achieve it.

Thanks in advance.

Regards,
chandru.

Comments

  • BeliasBelias Member Posts: 2,998
    try to wrap everything in an onrun trigger of a new codeunit and then do
    if not mycodeunit.run then
      Message('this is the error message: ' + GETLASTERRORTEXT);
    
    -Mirko-
    "Never memorize what you can easily find in a book".....Or Mibuso
    My Blog
  • chandrurecchandrurec Member Posts: 560
    Hi Belias,

    Will GETLASTERRORTEXT will return even the windows error also ?

    Thanks & Regards,
    chandru.
  • BeliasBelias Member Posts: 2,998
    Returns the text that was contained in the last error message that was displayed.
    well, the help doesn't say it doesn't work :wink:
    ...And i probably have used it with some automation in the past, too...but this is so easy to try that i don't want to steal you the fun :mrgreen:
    -Mirko-
    "Never memorize what you can easily find in a book".....Or Mibuso
    My Blog
  • chandrurecchandrurec Member Posts: 560
    Hi Belias,

    Thank you belias. Its working fine. :)


    Regards,
    chandru.
Sign In or Register to comment.