Need tips on finding the source of a warning

PevansPevans Member Posts: 18
In my event log I get the following warning:

This message is for C/AL programmers:

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


I know what causes this warning, but in my application there are LOTS of automation objects and I'd rather not go through all of the code manually.

Is there an easier way to find the object causing this ?

Any help appreciated, cheers.

Answers

  • ta5ta5 Member Posts: 1,164
    IMHO the messages are only written to the eventlog if the code was executed by nas.
    If so, try to start the codeunits from a normal client.

    Hope this helps.

    Thomas
  • krikikriki Member, Moderator Posts: 9,118
    ha5 wrote:
    IMHO the messages are only written to the eventlog if the code was executed by nas.
    If so, try to start the codeunits from a normal client.
    And start the debugger with no breakpoint on triggers. When the error occurs, the debugger will point to it.
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • PevansPevans Member Posts: 18
    The problem is that I am using a Web Connector (with NAS), and the top level of code that I can see is my QueueHandler ('CP Handler'.CQueueHandler), which gets an XML string as a parameter in a trigger.

    So I can't run the Codeunits locally. Is there any other way I can identify the source of this error?
  • DenSterDenSter Member Posts: 8,307
    That message means that your code is trying to access a property or a method of an automation type variable, without first creating it.

    There are two things you can do:
    1 - start NAS in debug mode. I don't know exactly how to do this, but the information is in the NAS manual. There's a parameter '/debug' or something like that that you have to add, and it will run the debugger for everything NAS is doing

    2 - this is what I always do... you stop the NAS service, and you run the codeunit that NAS runs from the object designer. That way you can turn the debugger on and off as you please, and you have direct access. Note that in order to stop a single instance codeunit, you have to either close Navision, open another database and go back, or open another company and reopen the one you were in. I always do Alt+F2 twice, whatever is the previous database.
Sign In or Register to comment.