Using Default Searches
Default searches can be configured on specific pages in the EUI to determine the records that are displayed. For example, when a user clicks a page, you might only want to display records that are assigned to them.
Prerequisites
Before making changes to the EUI, we recommend that you have a basic understanding of the following topics:
- HTML
- CSS
- Macros, methods, and conditionals, as they're used in the EUI
For more information on HTML and CSS, visit W3 Schools.
Updating the Default Search
To update the default search, you can use an existing saved search or create a new saved search.
- Navigate to the table that contains the records on which you want to run the search.
- Click the Search drop-down menu. Note the name of the search you'd like to use as the new default search, or click New to create a new saved search that you want to use.
Navigate to the EUI Templates table.
Edit the .html record that corresponds to the page in the EUI on which you'd like the search to run.
By default, the .html records you need to edit are named after the page titles in the EUI. For example, the My Service Requests page is
my_servicerequests.html
, the My Incidents page ismy_incidents.html
, and so on.Locate the line of code beginning with
#set
that lists the current default search:#set ($defaultsearch="My Incidents") <div class="wrapper"> <div class="top-space"></div> <div class="main"> #ew_include("header.htm") <div class="content"> <div style="float: left"><h2>$ewText.get('myinc.header')</h2> <div class="title-desc"></div></div> #ew_include("my_incidents-search.htm") #ew_status() <div id="main_frame"> #ew_table("incident" "" $defaultsearch "" "showToolBar=false&showNavigation=true&showfastsearch=false" "my_table" "")
- Following
($defaultsearch=
in the first line, replace the name in quotation marks with the name of the new default search. - In the last line of the code block shown above, ensure
$defaultsearch
is listed in the second set of quotation marks after#ew_table
. - Click Save. The default search is now updated.