I in LS hotspot I use subs that are in same LSLibrary. Parameters are decraled the same way for both subs.
GetApplicationDatabase(fieldname as string, targetdb as NotesDatabase, targetDbPath as String)
and second is like
GetCreditDoc(creditDoc as NotesDocument, BalanceDoc as NotesDocument)
The problem is that before exiting subs I have parameters set to what I need, but when I get back in code that calls these functions credtiDoc and BalanceDoc is nothing while targetDb and targetDbPath are OK.
First is called GetApplicationDatabase and then getCreditDoc. CreditDoc uses itself GetApplicationDatabase with differend params.
The result is the same even if I put the subs in the form.
I assume that in the subs you are doing some combination of .getDatabase(…) and .getDocumentByKey(…) etc.
The problem is that a NotesDocument is only valid as long as the NotesDatabase is still in scope. When you exit the subs your NotesDatabase is going out of scope and the associated NotesDocuments are no onger valid.
Thanx a lot. That was the case.I decided to declare global variables and left that Subs in the form. Although i am not happy with the situation when I have enough time I put some work on optimizing the code.