Dynamically display computed subform based on combobox selection

Domino Designer
I need to display a computed subform when a user selects an entry in a combo box. I have subforms named corresponding to the entries in the combo box and it is set up to refresh on keyword change. The subform formula specifies the the combo box name. Is seems this should be a no-brainer but doesn't work. I could put all the subforms on the form and use the hide property or use sections but I didn't want to go that route. Any help would be appreciated, thanks

Answer Wiki

Thanks. We'll let you know when a new response is added.

I agree this seems like a no-brainer, but it’s not. All subform names that need to be displayed has to be known when the form opens. Hide-Refresh formulas have no effect. The way I have dealt with this is to have a compose script that prompts the user for a keyword, creates the document and saves it to disk, then displays it to the user in edit mode. When this is done, the proper subform displays.

This is a tiny code snippet with no detail on how I prompt the user. Let me know if you need more. A forumula solution follows this code.

Dim workspace As New NotesUIWorkspace
Dim session As New notessession
Dim db As notesdatabase
Dim doc2 As notesdocument
Set doc2 = db.CreateDocument
‘Prompt for keyword value
‘set keyword value that controls subform selection
doc2.form = “MainDocument”
Call doc2.save(True, True)
Set uidoc = workspace.EditDocument(True, doc2)

Another way that I’ve made this work using formula is to give the user a form button that they click, prompt for a value, then end with a switch form to the same form name. This seems to work as well.

Rem “Code to prompt user for a value that subform will use to display”;
Rem “set the keyword field value selected”;
@PostedCommand( [ViewSwitchForm] ; “MainDocument” )

Discuss This Question: 2  Replies

There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.
  • NotesCon
    I also had this problem and I managed to display the sub-form finally by doing the following. Create a hidden text field named "FIELD1" and populate the field with the selected value from combo box. And in the default value of computed field type FIELD1. Good luck.
    0 pointsBadges:
  • Tvanharp
    Thanks for the replies, this is a web app which I forgot to mention. It does not make sense that I can dynamically display a subform based on user security but not from the value of a field. I think the problem lies in the refresh on keyword change, that must not re-evaluate the subform formulas. thanks
    0 pointsBadges:

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.


Share this item with your network: