Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Database-Driven Auto-Complete

This section allows the correct choices/values to be retrieved from a database file. In order to use this, simply enter the name of the database file, the name of the choice option field(s) you would like to search by, and the name of the choice value field you wish to return the value of to your application..

 

Selecting Multiple Columns

If there are multiple fields specified in the choice options field this will allow you to return multiple values The selection criteria can be used to filter the choices similar to an SQL WHERE clause. There is no need to qualify the database file name with a library name, although you can if required. Once the file name has been entered, the "..."  button in the choice options and choice value fields will open the dialog box shown below. This dialog lists all the fields in the specified file allowing easy selection of the correct field namesin the auto-complete search. However, only the first value in the field will be used to search, any other selected fields are for display only. Image Added

SQL Expressions

You can also use SQL expressions to return information in addition to just selecting database fields from the file. So in the example, using the expression TRIM(CNAME) || ', ' || CATID allows us to return a concatenated search value with formatting for our search, but the returned value to the application is unchanged.

Image Added

Max Choices
The max choices property allows you to set the number of choices you will see from your database-driven selection. There is no limit to the number of choices you can show, however if there is no limit set the default is 10.

Contains Match

This property when set to true looks for records that contain your search text. When set to false the query looks for your at the start of the records to match your search text. The default for this is set to false.

Dynamic Auto-Complete - Choices URL