Errorhandling when using Automation Variables

ta5ta5 Member Posts: 1,164
Hi

When using an automation variable (its a driver in this case), I face the ffw problem:
A variable ist declarated with "withevents=yes". Now the trigger "DriverObject::OnError(errorCode : Integer;message : Text[1024])" is visible.

When an error occurs, the code in this trigger gets excecuted. Thats cool. But afterwards the regular navision error message pops up and says: "this message is for c/al programmers....". This seems not so cool.

My question: is there away to avoid navision from showing the error message, since the error has already been handled in the error handler of the automation variable.

btnGo - OnPush()
IF ISCLEAR(DriverObject) THEN
  CREATE(DriverObject);
DriverObject.Open;

DriverObject::OnStatusChange(statusCode : Integer)

DriverObject::OnError(errorCode : Integer;message : Text[1024])
ERROR('error caught');



Any comments on this are appreciated.
Regards
Thomas

Comments

  • Marije_BrummelMarije_Brummel Member, Moderators Design Patterns Posts: 4,262
    What exact message is showing?

    It looks like the raiseevent from the automation control is causing somekind of problem in navision.
  • ta5ta5 Member Posts: 1,164
    Navision standard error handler says:
    "The call to member open failed. EFTDriver returned the following message: failed to connect to driver process."

    Regards
    Thomas
  • PevansPevans Member Posts: 18
    Maybe it's because...

    This message is for C/AL programmers:

    This Automation variable has not been instantiated.
    You can instantiate it by either creating or assigning it.


    ...is not an error but a warning?

    I am assuming that was the error message you were talking about.

    By the way: What did you mean by:
    A variable ist declarated with "withevents=yes".

    Is "withevents" a property in your Automation object?
  • ta5ta5 Member Posts: 1,164
    Hi
    Thank you for the input.
    The error message was a specific one (one from the driver).
    WithEvents: This is a property of the automation variable (see property of any automation variable)

    Regards
    Thomas
Sign In or Register to comment.