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

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.

-ADS BY GOOGLE

SearchWindowsServer

Search400

  • iSeries tutorials

    Search400.com's tutorials provide in-depth information on the iSeries. Our iSeries tutorials address areas you need to know about...

  • V6R1 upgrade planning checklist

    When upgrading to V6R1, make sure your software will be supported, your programs will function and the correct PTFs have been ...

  • Connecting multiple iSeries systems through DDM

    Working with databases over multiple iSeries systems can be simple when remotely connecting logical partitions with distributed ...

SearchDataCenter

SearchContentManagement

Close