--- alias: find-entity-control description: "The Find Entity control offers a dynamic search mechanism for locating object instances within the system" --- # Find Entity Control The Find Entity control is a text box search component used throughout the application that provides an incremental search mechanism to search for and select a particular object instance: ![FindEntityControl][FindEntityControl] To find an entity by name, just type in the first letters of the entity and the system will look for all the entities that begin with what is being typed. If the search is narrowed down to a single object, the system will automatically complete the query and select that object: ![FindEntityControlAction1][FindEntityControlAction1] The component also offers the following possibilities: * When an object is selected, you can clear the selection by using the X on the right side of the text box. * Opening and closing the list by selecting :core-static-select-sm: on the right of the control. !!! note The **Return** key on your keyboard will have the same behavior as selecting the :core-static-select-sm: icon. * You can see how many objects match a specific name pattern, which can be a hint of whether the search term is accurate. * You can force the control to return a specific number of results by editing the `/Cmf/Guis/Configuration/Common/Paging/Controls/FindEntityControl/NumberOfResults` configuration entry. For more information, see [Configuration](../administration/configuration.md). * The component can be configured to allow you to create a new entity of the same defined type directly from the search results, as shown in the following image: ![FindEntityControl_Create][FindEntityControl_Create] Selecting :material-plus: will open a wizard to start the creation process for a new entity. ## Barcode Support You can use barcodes to find the object you need in Critical Manufacturing MES. Select the :material-camera: icon in the textbox: ![Screenshot showing a control with a camera icon used for finding an object by scanning a barcode.](images/findentitycontrol_barcode01.png) This will open a popup window that will allow you to use a camera or a barcode scanner to read the term you want to use in your search: ![Screenshot showing a popup window with options for using a camera or barcode scanner to read a product code.](images/findentitycontrol_barcode02.png) If you do not have a camera or it is disabled, you can use **Open Manual Code** for your search: ![Screenshot showing a barcode scanning control on a user interface.](images/findentitycontrol_barcode03.png) This will open the following window: ![Screenshot showing a product search window with a barcode scanner interface, displaying "Product Code" and a scanned code.](images/findentitycontrol_barcode04.png) !!! info To use barcode scanning when searching for an object, the `Allow Barcode IDs` flag must be active for the **Entity Type** you want to search. For more information, see [Entity Types](../administration/entity_types.md). !!! info For more information on barcodes, see [[barcode-identification-index]] and [[smart-barcode-scanning]]. ## Revision Selection When using the control to find versioned entities, you can select a specific revision or version in the Revision/Version dropdown: ![Screenshot showing the Revision/Version dropdown menu with options.](images/findentitycontrol_revision1.png) ![Screenshot showing the Revision/Version dropdown control for selecting a specific revision.](images/findentitycontrol_revision2.png) !!! info Only active/default revisions will be available for selection. ## Defining Searchable Properties When an entity has properties defined as searchable, the property values will be displayed in the control when it is opened and will show the matching values as the terms are input into the search box, depending on the specific search type defined for the property. As an example, here is a **Calendar** with two searchable properties defined: * `Name` (set by default, defined with search type = `Starts With`) * `Description` (defined with search type = `Contains`) Since we defined `Starts With` as the search type for `Name` and `Contains` as the search type for the `Description` property, searching for a given value will result in hits in both the `Name` and the `Description`, showing in bold the term as it matches the found entities, with both properties displayed in the control: ![Screenshot showing search type options for properties.](images/fec_search_type.png) In some situations, additional fields can be displayed along with the searchable properties as a way to provide further detail for a specific operation. An example is below, showing `Name`, `Description` and `ModifiedBy` as searchable properties, with the added property of `Scalar Type` as a helper for the context for **Parameter** selection: ![Screenshot showing additional fields that may be displayed alongside searchable properties.](images/fec_additional_fields.png) For more information on how to define these properties, see [[user-guide-entity-types#searchable-properties]]. ## Advanced Mode You have the possibility of overriding the default settings for the find entity control by entering the advanced mode that is available when the main window of the component is displayed. This will allow you to use a different query from the default one that is used when attempting to search for a specific object. When performing a search for an object, you use a default query that applies specific filters based on the current context for the object and the entity type. Selecting the :core-static-search-sm: icon will open the main window of the component and display an **Advanced** button. Selecting that button will display a new window, which allows you to select a custom query to be used as a filter. It will also allow flexibility to create your own query, preview the results and use the new query in this situation: ![Screenshot showing the Advanced Mode filtering options for entity control in the find entity control.](images/findentitycontrol_advancedfiltering.png) !!! info For more information on how to create your own query, see [Queries](../administration/queries.md). When you are overriding the default query with a custom one, the list of objects found is shown with an indication that a custom query is currently being used and the visual indicator of the **Advanced** button is shown in a different color: ![Screenshot showing a UI element labeled "Filtered Results" in Advanced Mode.](images/findentitycontrol_advancedicon.png) [findEntityControl]: images/FindEntityControl.png [FindEntityControl_Create]: images/FindEntityControl_Create.png [findEntityControlAction1]: images/FindEntityControlAction1.png