Salesforce

Auto-Complete Strategy and Application

« Go Back
Article

Overview

Auto-Complete input fields are used to fetch results from the server without directly loading the records on the Visualforce page. When the user starts typing a string on an auto-complete field, it will fetch records that contain said string of characters from the server, and give these as options to select from. There are a number of settings that can customize how long this string needs to be in order to start querying results from the server, which is especially handy when the database contains thousands of the queried record, as only a certain maximum can be displayed as options.

Application 

By default, autocomplete fields start querying results when the user has typed 2 characters in. When the specified number of characters has been entered, queried records beginning or containing those characters will populate a drop-down list with options, which has a light-blue background color. As opposed to the white-background on standard picklist display.

As mentioned earlier, there are a number of settings (which apply to all the users and division contained in the environment org) that control how many characters do users need to type in for the query to be initiated. Also, it is possible to define a specific number of characters for auto-completes on entities such as Customers, Products and/or Inventory Item.

The default number of characters to be entered for the auto-complete fields to start querying records is 2. This can be overridden by Application Setting with name autoComplete_minimumChar. This Application Setting can also be overridden with object-specific values, by adding additional Application Settings:

  • For Inventory Item auto-complete fields, applies to multiple pages where the Inventory Item is queried: autoCompleteIcitem_minimumChar.
  • For Customer Master auto-complete field, on Sales Order pages: autoCompleteSocust_minimumChar.
  • For Product Master auto-complete field, on Sales Orders, RMA Details and other pages where the Product Master is queried: autoCompleteSoprod_minimumChar.

User-added image  IMPORTANT   Application Settings autoComplete_minimumChar or autoCompleteSoprod_minimumChar only affect Product fields when custom setting salesorder_preloadproducts is set to False. Otherwise, the Products are already loaded when the page is displayed, and typing characters does not send queries to the server but simply filters loaded records by those that contain the entered string.

Navigation
 
Setup > Build > Develop > Custom Settings

Click on Manage (Action column) for Application Settings (Label column)

Fields

Name:  Name of the data set, to be used when the custom setting data is referenced by Apex. Needs to be specified exactly as one of below:

  • autoComplete_minimumChar
  • autoCompleteIcitem_minimumChar
  • autoCompleteSocust_minimumChar
  • autoCompleteSoprod_minimumChar


Value:  Number of characters needed before autocomplete is enabled.

User-added image  EXAMPLE  Setting Value to 4 will cause the auto-complete values to not start listing until the user has typed 4 characters
 
Description:  (Optional) Summary of application function

Processing
  • Locate Application Setting/s to modify, and click Edit.
  • Enter a numeric Value, and Click Save.
  • If the Application Setting/s does/do not exist already, click New and add one/s, as per fields described above.
 

SEE ALSO

Application Settings Description

Settings
Auto-Complete Strategy and Application
Auto-Complete-Strategy-and-application

Powered by