Manage Learn to apply best practices and optimize your operations.

Computed subform based on user's action

If a computed subform formula is based on a field and the user changes that field's value, the subform does not refresh. This quick tip changes that.

As you know, computed subform formulas are evaluated when a form is opened. If the formula is based on a field and the user changes that field's value, the subform does not refresh, not even you if select the "refresh on keyword change" property.

If the subform to display depends on an user's choice, let her made the selection BEFORE opening the form; that is, instead of calling the form, call an action to do the following:

1. Let the user make her selection and store the result in an environment variable with @SetEnvironment("name"; value).

2. Call the form (with 'compose'); the field that contains the user's selection must be computer when created with the formula @Environment("name").

3. Notes evaluates the subform formula and shows the correct subform.

Here's the code for doing this.

 _selection := @Prompt([OkCancelList]; 
"New doc"; "Select value:"; ""; list_of_values);

@SetEnvironment("user_selection"; _selection);

@PostedCommand([Compose];"form_name")

REM {computed when created field};
@Environment("user_selection")

Do you have comments on this tip? Let us know.

This tip was submitted to the SearchDomino.com tip exchange by member Jordi Sanchez. Please let others know how useful it is via the rating scale below. Do you have a useful Notes/Domino tip or code to share? Submit it to our bimonthly tip contest and you could win a prize and a spot in our Hall of Fame.

Dig Deeper on Lotus Notes Domino Formula Language

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