Search code examples
lotus-noteslotus-dominolotusscriptlotus

Lotus script - database script initialize method not fired


faced new strange problem: I have several databases (cloned - similar with same/different files). But trick in that if I open one database Database script Initialize method is fired, when I try to open another database, database script initialize method doesn't fire. In initialize method I only setting session variables. So not setting variables, makes errors working in database

Found same situation but there no solution provided

http://www-10.lotus.com/ldd/nd6forum.nsf/d202cf70fecca50b852569ff00736545/008ac7ae806ef01d852579dd002a6194?OpenDocument


Solution

  • QueryOpen and Initialize- events are only fired once, when a database is opened. Notes Client and Designer SHARE an instance of the same database.

    As long as a database is open in designer (and it can be tricky to "really" close it without removing it from the working set), the events in the client will never fire, as the database is considered "open".

    EDIT: As D.Bugger stated in his comment (Thanx for that) you can close the database in designer by right-clicking it and select Close Application from the context menu.

    Same is true for all other database events: Any changes will not be visible, until all instances of the database are closed in Client AND Designer.

    And events "QueryClose" and "Terminate" will not run before database is closed everywhere.