Implement two fields with dynamic choices

Hi,

I have a request which is puzzling me and you might help out. This is a application for Notes Client only.

There are two fields on a Notes Form. FieldA is radio button type and FieldB is check box type.

  1. Choices on FieldA should be configurable.

  2. Run-time pick on FieldA should dynamically determines the display of the choices on FieldB.

Any tip on how to implement those, especailly on how to do #2 above.

thanks much!

Subject: implement two fields with dynamic choices

  1. Store the values in a document somewhere and use an @Dblookup to populate the list of values for the radio button. Make sure that you select “Refresh fields on Keyword change” for this field.

  2. Use an @Dblookup to populate the list of values for the radio button. Make sure that you select “Refresh choices on document refresh”.

Ethann Castell

Caliton Innovations

web: http://www.caliton.com | blog: http://www.ethann.com

Subject: implement two fields with dynamic choices

Geez… How many ways can you skin a cat?!

Your first question can be answered a number of ways.

If you want to offer a dynamic selection list based on the existing contents of the database (e.g. a category list based on the categorization of the existing documents), then you would use a formula for the choices (e.g. Use @DbColumn to retrieve a list of the existing categories from one of your system’s categorized views). You would also tick the checkbox - “Allow values not in list” - to allow users to add to the dynamic choices.

If you wanted to strictly control the options available to the users, but still make it configurable, why not use a simple Profile document? Make the management of that document available to authorized users, and then use a different formula for the field choices - “@GetProfileField” for example.

Either way, you’ll want to tick the checkbox - “Refresh fields on keyword change”. This will ensure the options listed for your SECOND field are refreshed based on the selection in the first field.

Now, the choices for the second field could be more difficult to code, because in the first instance (dynamic selection) you’ll have no control over the options the users create.

In the second instance, you could configure additional fields on the Profile document to hold “sub-options”, and simply use another formula to retrieve those - Not pretty!

Typically, for this sort of solution, I create an entire “keyword” area in a system. You would categorize your keyword documents (This categorization would form the options list for your first field). All of the keywords in a category would then become the selection list for the second field. Your field formulae would then simply refer to a “keywords” view (the first being a @DbColumn, and the second being a @DbLookup).

Remember, with the second field, tick the “Refresh choices on document refresh” checkbox. That’ll ensure that when the first field refresh is triggered, the options in the second field are adjusted accordingly.

Hope that helps!

T.