1C:Enterprise 8.3. Practical Developer’s Guide. Lesson 19 (0:40). Database search. Search during input by string

Search during input by string

In Designer mode

1C:Enteprise features another powerful search tool: search during the input in a text field. You encountered this feature earlier when you added materials or services to document tabular sections. 

You can set up the input by string feature in the configuration object editor, on the Input fields tab. This is applicable to objects that are used as referential fields. The following parameters are available:

  • Search method. Default value: At beginning of line
  • Full-text search. Default value: Do not use
  • Search results display mode. Default value: Regular

Let us edit these parameters.

  • For the MaterialsAndServices catalog, set the parameters as shown in fig. 19.15.

    Lesson 19 (0:40). Database search / Search during input by string / In Designer mode
    Fig. 19.15. Input by string parameters

So, when a user enters a value to a field that references a material or a service, the platform performs the full-text search in background mode (as a background job). Both the full-text search option and the background search option are especially helpful when your database contains a large amount of data.

If your database is small, using the full-text search is not necessary and we recommend searching anywhere in the line instead of searching at the beginning (set Search method to Anywhere in the line).

During the applied solution execution you can change the values of these parameters using 1C:Enterprise script tools, namely the AutoComplete and TextEditEnd client event handlers of text fields. You can also implement this in the manager module of the object whose data is to be searched, in the ChoiceDataGetProcessing event handler (except the search results display mode property).

In 1C:Enterprise mode

Let us test the changes.

  1. Start 1C:Enterprise in the debug mode.
  2. Open the Material and service prices register and start the creation of a new price.

    Once you start typing in the Material or service field, which has the material or service reference type, the drop-down list displays the material or service items that begin with the typed characters (fig. 19.16).

    Lesson 19 (0:40). Database search / Search during input by string / In 1C:Enterprise mode   
    Fig. 19.16. Search by string that is being typed

    According to the properties that you specified in Designer, this is performed as a full-text search in background mode.

Leave a Reply

Your email address will not be published. Required fields are marked *

1C:Enterprise Developer's Community