Manage Learn to apply best practices and optimize your operations.

Refresh computed subform

How to calculate for a computed subform after the form is open.

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.



  1. Create a Form (Make it default notes form)
  2. Create a dialog box field "Action."
  3. We want to open subform based on the selection.
  4. 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.


Dig Deeper on LotusScript

SearchWindowsServer

Search400

  • Favorite iSeries cheat sheets

    Here you'll find a collection of valuable cheat sheets gathered from across the iSeries/Search400.com community. These cheat ...

  • HTML cheat sheet

    This is a really cool cheat sheet if you're looking to learn more about HTML. You'll find just about everything you every wanted ...

  • Carol Woodbury: Security

    Carol Woodbury

SearchDataCenter

SearchContentManagement

Close