View member feedback to this tip.
If you want to load a computed subform based on a user selection (from dialog box, check box...). The calculation for a computed subform is done at Form Open, so once the form is open you can't change the subform on fly.
Don't worry --here is the order of tasks and code for the process.
- Create a Form (Make it default notes form)
- Create a dialog box field "Action."
- We want to open subform based on the selection.
- Put the following code into onExit event of field Action.
Dim workspace As New NotesUIWorkspace
Dim uidoc As NotesUIDocument
Dim new_uidoc As NotesUIDocument
Dim doc As NotesDocument
Set uidoc = workspace.CurrentDocument
Set doc = uidoc.Document
Call doc.computewithform(True, False)
Call Workspace.SetTargetFrame("")
Set new_uidoc= Workspace.editdocument
(True, doc)
uidoc.document.saveoptions = "0"
Call uidoc.close
'refresh the document
Call new_uidoc.reload
Call new_uidoc.refresh
MEMBER FEEDBACK TO THIS TIP
This is a good tip. You can avoid using a default form (in some case you can have several forms involved, or the default form is already used).You just add assigning a value to the form item before the computeWithForm:
doc.form = "MyFormName"
doc.computeWithForm true, false
Thierry S.
Do you have comments on this tip? Let us know.