Create(automation) = false

MarcelWMarcelW Member Posts: 46
Hello,

ich want to create an instance of an automation server variable.
Here is a code snippet to see:
IF NOT ISCLEAR(OApplication) THEN CLEAR(OApplication);

IF CREATE(OApplication, TRUE) THEN
  MESSAGE(':-(')
ELSE
  MESSAGE(':-)');

...

The instance can't be created every time! :?

I have no idea to solve the problem.
I hope someone of you can give a tip to me!

Bye

Comments

  • toortoor Member Posts: 52
    Hey Marcel,

    why do clear an re-instantiate the ac? Maybe it's a timing problem of clear and create. I've had similar problems with an ac in an asp-project.

    So, try to use the first instance all the time.

    Wich ac do you use?

    Greetings to cg

    cheers
  • DenSterDenSter Member Posts: 8,307
    Try the other way around:
    IF ISCLEAR(OApplication) THEN BEGIN
      IF CREATE(OApplication, TRUE) THEN
        MESSAGE(':-(')
      ELSE
        MESSAGE(':-)');
    END ELSE BEGIN
      MESSAGE('Did not re-initialize the AC');
    END;
    
  • MarcelWMarcelW Member Posts: 46
    Thanks for the answers.

    My code is the result of several tryings to fix the problem.
    I tried all variants of the code i could imagine.

    But i had solved the problem:
    I use a simple 4.0 Client and the last registered dll was the one of an
    newer version of Navision 4. So the old version used the newer dll.
    That was the problem!

    Thanx, Marcel
Sign In or Register to comment.