Have you ever wished it was possible to program an event such as QuerySave in both @Language and LotusScript? Sometimes the most efficient (or only) way to perform a specific task is to code the event using @Formula and @Commands. That works fine until a request comes along in which LotusScript is the only solution. Using Evaluate within LotusScript can sometimes be a solution but there is another way to achieve this.
1) Create a class
2) In the constructor for the class create an event handler for the event and set it to invoke a sub of that class
3) Create the method using the same signature as the event with the LotusScript code and put all the LotusScript code in there
4) In the QueryOpen event create an instance of the class passing the NotesUI object (this can be any event invoked prior to the called event - QueryOpen is usually the first and is usually the best)
5) Place the @Language component in the actual event on the form/page.view
When the event is fired the @Language coded in the the actual event will be executed and then the eventhandler coded in the class will be executed....
Form example:
Class MyClass
Sub New(Source As NotuesUIDocument)
On Event QuerySave From Source Call OnQuerySaave
End Sub
Sub OnQuerySave(Source as NotesUIDocument,Continue As Variant)
' Place all LS QuerySave code here
End Sub
End Class
Dim Var As MyClass
Sub QueryOpen(Source As NotesUIDocument)
Set Var = New MyClass(Source)
End Sub