Object reference not set to an instance of an object occurred when attempting to 'Run script'.

On a form's "When user exits form", I have a visual script which is inserting a record into a table.  The form is part of the initial action of a process.  When I exit the form, the visual script executes the database insert successfully, but Metastorm does not create the new record in the process table.  The error I get is:

 

"Exception 'Object reference not set to an instance of an object.' occurred when attempting to 'Run script'. Object reference not set to an instance of an object."

 

(If I delete the visual script and run Metastorm, then Metastorm successfully creates the new record in the process table.)

 

Has anyone encountered this error before?

 

(I'm running version 9 with SR2 using SQL Server 2005)

Tagged:

Comments

  • Is this in the creation action then? I assume it must be as you say the Metastorm Process record is not created.

     

    I will have a go at an example today if I get a chance.

  • Yes, the Metastorm process record is not created yet.  Originally I did have my DB insert in the creation action's "When action completed" which would be the ideal place, but I wasn't able to reference any local variables from there.  So I tried it in the form's "When user exits form" because I can reference local variables there.

  • Well, we've been looking at this a bit. The custom table record will get created if you have some variables in the process, if the variables are on the form, and if the variables are filled. If the variables are not on the form, or are not filled, the custom table record will not be created. We do not see any errors, however.

     

    This is working as expected, I believe, although the fields being on the form but left empty and the record then not being created does break my fondest principle: The Principle of Least Astonishment.