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.