Defining the Search Specification Property or the Sort Specification Property
You define the Search Specification property or the Sort Specification property of an object the same way define the expression for a predefined query except that you do not identify the business component and you do not include the following reserved words:
Search
Sort
Example Expressions That the Search Specification Property Can Contain
The following are example expressions that the Search Specification property can contain:
"[Close Date] > ""04/15/95"""
"[Opportunity] LIKE ""C*"""
"[Revenue] > 500000 AND [State] = ""CA"""
"[Revenue] > 500000 OR [Revenue] < 10000"
"([Revenue] > 500000 AND [State] = ""CA"") OR ([Revenue] > 200000 AND [State] = ""FL"")"
"NOT ([State] = ""CA"")"
The entire search specification must reside on one line. If you use more than one line, then Siebel CRM displays a message that is similar to the following at run time:
"Invalid search specification..."
Note the following:
Each field that an expression references must exist in the parent object, such as a business component or report, and it must use the format that the object type requires.
If the user drills down on a record, and if the Search Specification property that is defined for the target applet is different than the Search Specification property that is defined for the originating applet, then Siebel CRM displays the first record of the destination view instead of the drilled-down record.
A search that involves the Search Specification property is case-sensitive. You can use the ~ (tilde) modifier to make the search case-insensitive. For example, you can use the following code:
[Last Name] ~LIKE 'g*' or [Last Name] ~= 'GRANER'
Example That Includes a Sort in the Sort Specification Property
The following examples include a sort in the Sort Specification property:
"[Close Date]"
"[Opportunity] (DESCENDING)"
"[Revenue]"
"[Revenue] (DESCENDING)"
"[Revenue] (DESC), [State]"
Sorting With a Predefined Query
To modify the expression that a saved query uses, you can use the PreDefined Query view to add a sort expression. You can specify one or more fields that refine an ascending or descending search. You can use the following format for a predefined query:
'Business Component Name'.Sort = "[Field] [[(DESC[ENDING])], [Field]
[(DESC[ENDING]],...]"
where:
Business Component Name is the name of the business component that Siebel CRM sorts.
Sort indicates a sort expression.
Field is the name of the field that Siebel CRM sorts.
Sorting in the Client
To do a sort in the client, the user can sort items in a list column, use a predefined query, or you can configure the Search Specification property. To specify an ascending or descending sort after Siebel CRM gets data, the user can click a list column header in a list applet, and then click a sort button. For more information, see Siebel Fundamentals.
Sorting Versus Searching
Siebel CRM creates:
The ORDER BY clause in the SQL code from the sort specification.
The WHERE clause in the SQL code from the search specification.
Siebel CRM does not support the GROUP BY clause for a business component.