Automatically Run a Search List When a Search Screen Opens
With the new EnableAutoSearch attribute for the SearchList element, you can now display default search results automatically when users access search screens through form fields.
By default, the Results grid on search screens is empty until users click Search. But when you set the EnableAutoSearch attribute to "true" in a form field's SearchList element, the Results grid automatically displays search results when users access the search screen through the form field.
A new Kitchen Sink sample demonstrates the EnableAutoSearch attribute and other settings for search fields. From Kitchen Sink, click Data forms under More tasks. Then on the Data forms page, click Search List Field under Fields. The Kitchen sink search list fields screen includes three fields to demonstrate the autosearch functionality: With Auto Search, With Auto Search and Quick Find, and Persistent Search with Auto Search.
When you click the search icon in any of these fields, the search screen appears with default search results already in place in the Results grid. The grid displays the same search results as if you clicked Search on the screen without specifying any search criteria. For example, when users click the search icon in the With Auto Search field, the Kitchen Sink Individual Search screen automatically displays the first 100 Kitchen Sink individual records in alphabetical order.
This functionality is implemented within the FormMetaData element on the add data form spec for the Kitchen sink search list fields screen. Within the FormField elements for both the Default settings and With Auto Search form fields, the SearchList elements calls on the same search in the SearchListID attributes. The difference between the fields is that the SearchList element for the With Auto Search form field also sets the EnableAutoSearch attribute to "true" so that the search list automatically display search results when users access it through the field.
<common:FormMetaData>
<common:FormFields>
<common:FormField FieldID="SEARCHLIST" Caption="Default settings">
<common:SearchList SearchListID="1072b69d-7092-4d30-99fa-3f57925d3942" />
</common:FormField>
<common:FormField FieldID="SEARCHLISTAUTO" Caption="With Auto Search" >
<common:SearchList EnableAutoSearch="true" SearchListID="1072b69d-7092-4d30-99fa-3f57925d3942" />
</common:FormField>
The inclusion of the EnableAutoSearch attribute with a value of "true" also distinguishes the With Auto Search and Quick Find field from the With Quick Find field and the Persistent Search with Auto Search field from the Persistent Search field.
Tip: For more information about the EnableAutoSearch attribute, see Automatically Run a Search List. And for more information about the Kitchen sink search list fields screen, see Search Fields.