Skip to main content
Version: 6.18 (draft)

Search support for scripted autocomplete fields (#641437)

Data fields of the type Autocomplete can now be indexed and are available for search in the Web Client and via script.

The following information is indexed:

  • Internal value
  • Static display value
Dynamic display values

If the use of dynamic display values is implemented in the autocomplete script (setDynamicDisplayValue set to true, these values are not indexed because they are not saved to the database. This means that fields with dynamic display values which reference other entities (cases, contacts, resources or users) cannot be found via quick search when the display name of the entity is used as a search term.

If the fields should be available in the detail search, it is necessary to implement the method ScriptAutocompleteResult onDetailSearchInput(String pSearchStr, FieldKey pKey) in the autocomplete script. It must return the selectable entities without relying on the context. The template for scripts of the type Text autocomplete has been adjusted accordingly.

Autocomplete script

Please review the autocomplete scripts for all autocomplete fields which should be searchable to make sure that they implement the new method and handle the display value in the desired way.

The recommended way of adding values in the script is:

  • Text fields: result.add("value to save", "value to save")
  • Fields with object references: result.add(ticket) (quick search not available) or result.add(ticket, "value to save") (quick search available)
  • For fields with object references, it is recommended to add the object via a search by criteria so that wildcard searches are possible.

An info box has been added to the setting Indexed for search in the data field details to explain the scope of indexing.

Update behavior

If an autocomplete field already had the setting Indexed for search applied, the setting is automatically removed on update. You need to set it again to create the required index tasks.