Automatically Run a Search List

With the new EnableAutoSearch attribute for the SearchList element, you can now automatically execute search lists that users open through search icons in form fields.

By default, when users access search screens through fields on data forms, the Results grid is empty until they enter search criteria and click Search. The EnableAutoSearch attribute allows you to automatically display search results in the Results grid when users first access search screens this way. They can still enter search criteria to filter the results as necessary, but the initial search results are in place as soon as they open the search screen.

On data form specs, you can create search fields in the FormMetaData element within either the FormFields or UIFields elements. Within both elements, the child FormField element describes how to represent a single field on a data form. And within the FormField element, the SearchList element indicates a field that allows users to access a search list to select data for the field.

Within the SearchList element, the SearchListID attribute provides a GUID for the search list. When users click the form field's search icon, the search screen appears and they can enter search criteria to select data from the search results. To display default search results when the search screen first appears, you set the EnableAutoSearch attribute to "true." When users access the search screen, it displays the same search results as if they clicked Search without specifying any search criteria.

<common:FormMetaData>
<common:FormFields> <common:FormField FieldID="SAMPLESEARCHFIELD" Caption="Sample Search Field" >
<common:SearchList SearchListID="1072b69d-7092-4d30-99fa-3f57925d3942" EnableAutoSearch="true" />
</common:FormField>

Tip: For more information about the SearchList element and its EnableAutoSearch attribute, see SearchList Element. And for information about new Kitchen Sink sample that demonstrates the EnableAutoSearch attribute, see Automatically Run a Search List When a Search Screen Opens.