Develop > Tailoring Best Practices > Form tailoring > Changing the options available based on prior user input

Changing the options available based on prior user input

Forms Designer offers two methods for you to change what options are available based on prior user input.

  • Use DVD select statements to change what options appear on a form
  • Use recursive fills to change what records the user can select as options

You can determine which of these two methods to use by how you want to change the list of available options.

If you want to change what options are visible on form, then use one or more DVD select statements.

If you want to change the list of records that a user can choose from, then use one or more recursive fills.

DVD select statements

A DVD select statement changes what controls or values appear on a form based a triggering condition. You determine what controls or values the DVD select statement displays by assigning a condition to each control or value. When the condition is true, the system displays the controls and values. When the condition is false, the system hides the controls and values.

Example DVD select statement where the display condition is false

Example DVD select statement where the display condition is true

The key benefits of a DVD select statement are listed below.

  • The user only sees the controls and values when the appropriate condition applies.
  • The user has a visual indicator that new options or controls are available.

The costs of a DVD select statement are listed below.

  • The more conditions there are to evaluate, the more system resources if takes to display the form.
  • You have to reserve part of the form's screen space to display hidden items.
  • You must create a query for the DVD select statement condition.
  • The only way to change the list of values is to change the value of each individual control of the DVD select statement.

Since DVD select statements depend upon queries for the condition, any inefficiencies in the underlying query will negatively affect your system performance. Following the best practices in How do I write a good query? will reduce this performance impact. In addition, the more conditions you have, the more of the form's screen space you will have to reserve for the controls hidden by the DVD statement.

In general, a DVD select statement is best used in the following circumstances.

  • There are only a few conditions that change the options available on the form.
  • The list of options either does not change at all or changes infrequently.

If you have a lot of conditional data to manage, consider using multiple Comfill controls with recursive fills instead. This allows you to restrict the options displayed in one Comfill control based on the selections in a previous Comfill control. Also, if you expect to frequently add or change the options available to the DVD select statement, you may want to use a Comfill control so that you can add or update the options as records.

Recursive fills

A recursive fill uses the value of one Comfill control to determine the available values of another Comfill control. You determine what values the recursive fills display by adding a link record line entry for each Comfill control on the form. When a link record includes the expression $fill.recurse=true, then the system evaluates each line of associated link record. You may also want to associate a search form or QBE format for each Comfill control in the recursive fill to make easier for users to select multiple values.

Example Comfill controls linked by recursive fills

Example QBE formats allowing users to select a Category, Area, and Sub Area.

Example completed recursive fill

The benefits of recursive fills are listed below.

  • You can use a query to ensure that users only select valid combinations of values.
  • Users can select values for related data in one process.
  • The system only has to display one page's worth of options at a time. It takes less system resources to display a partial list than the full list of options. The longer the list of options is, the more efficient it is to display the list in pages.
  • You manage the list of possible values by updating the related records linked to by the fill. For example, as you add, update, or remove contact records any fill linking to contact records will automatically pick up these changes.

The costs of recursive fills are listed below.

  • You must create a link record entry and a query for each Comfill control.
  • You must create a search form if you want the fill functionality to use it.
  • Users can only select values that match the query for each Comfill control

Since recursive fills depend upon link queries, any inefficiencies in the underlying query will negatively affect your system performance. Following the best practices in How do I write a good query? will reduce this performance impact. In addition, you must be very familiar with the Service Manager data model to create the necessary queries.

In general, a recursive fill is best used in the following circumstances.

  • The value of one field determines the value another field can have. Typically, all of the fields come from a set of related records.
  • The list of options changes frequently, and you want your Comfill controls to always have access to the most recent changes.

If you want to hide or display data on a form, use Combo Box controls and DVD select statements instead.