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.