Configuring Siebel Business Applications > About Applets, Controls and List Columns > Options to Create an Applet >

Options to Filter Data That Siebel CRM Displays In an Applet


A search specification is an expression you can define in the Search Specification property that filters the set of CRM data that Siebel CRM displays in an applet. This topic describes a search specification for an applet, but this information typically applies to the search specification for a business component, link, or list.

For more information, see the following topics:

The search specification contains the names of one or more fields in the business component and various operators. These items constitute a logical condition that identifies the records that Siebel CRM displays in the applet:

  • If the result of the search specification is TRUE for a Siebel CRM record, then Siebel CRM displays the record in the applet.
  • If the result of the search specification is FALSE for a Siebel CRM record, then Siebel CRM does not display the record in the applet.

The following search specification describes how you can filter CRM data so that Siebel CRM only displays records that contain a revenue that is greater than 5000:

[Revenue] > 5000

The following search specifications include more examples of how you can filter CRM data:

[Type]= "COST LIST"

[Competitor] IS NOT NULL and [Competitor] <> "N"

[Type] = LookupValue ("TODO_TYPE", "In Store Visit")

Parts of a Search Specification

Table 20 describes some of the parts of a search specification.

Table 20. Parts of a Search Specification
Element
Description

Comparison Operator

Compares the value in a field to a constant, or the value in one field to the value in another field. Siebel CRM allows the following operators:

  • = (equal to)
  • <> (not equal to)
  • > (greater than)
  • < (less than)
  • >= (greater than or equal to)
  • <= (less than or equal to)

The following is an example search specification that uses the greater than comparison operator:

[Revenue] > 5000

String Constant

You use double quotation marks to enclose the string constant. A string value is case sensitive. Uppercase and lowercase letters in a string constant must match exactly the string that the Siebel CRM record contains. The following is an example search specification that uses the COST LIST string:

[Type] <> "COST LIST"

Logical Operator

The logical operators AND, OR, and NOT negate or combine elements in a search specification. Siebel CRM ignores case in these operators. For example, and does the same operation as AND. The following is an example search specification that uses the AND logical operator:

[Competitor] IS NOT NULL and [Competitor] <> "N"

Field Name

You use square brackets to enclose a field name in a search specification. The following is an example search specification that references the Conflict Id field:

[Conflict Id] = 0

LIKE Operator

The LIKE operator creates a text string search specification where the specification compares the value of a field to a constant, or compares the value of a field to the value of another field. A match on only the first several characters in the string is required. The LIKE operator uses the following wildcard characters:

  • * (asterisk). Indicates any number of characters.
  • ? (question mark). Indicates a single character.

The following is an example search specification that uses the LIKE operator:

[Last Name] LIKE "Sm*"

In this example, the Last Name values of Smith, Smythe, Smallman, and so on, causes the search specification to evaluate to TRUE.

Length

The search specification must not exceed 255 characters.

How Siebel CRM Handles a Hierarchy of Search Specifications

If multiple search specifications exist on an applet, business component, link, or list, then Siebel CRM uses the object hierarchy to determine how to run these search specifications. For example, if a search specification is defined on the applet and on the business component, then Siebel CRM does the following:

  1. Appends the search specification on the applet to the search specification on the business component. Siebel CRM does not override the search specification on the business component. You cannot use a search specification on an applet to override a search specification that is defined on the underlying business component.
  2. In the Siebel client, Siebel CRM converts the search specification on the applet to a WHERE clause.
How Siebel CRM Runs a Search Specification That Is Defined on a Child Applet

If a search specification is defined on a child applet, then Siebel CRM does the following:

  • If a child applet references the same business component as the parent applet, then Siebel CRM does not run the search specification that is defined on the child applet.
  • If a child applet does not reference the same business component as the parent applet, then Siebel CRM does the following:
    • To maintain the context for the search specification with the parent applet, it amends the search specification that is defined on the child applet with a WHERE clause.
    • Runs the search specification that is defined on the child applet.
How Siebel CRM Runs a Search Specification That Is Defined on a Link or List

If a search specification is defined on a link, then Siebel CRM does the following:

  • The Search Specification property of a link applies to the child business component. If a search specification exists in the applet, then Siebel CRM uses an AND query operator to add the search specification that resides on the applet to the search specification that resides on the link.

    A sort specification on a link only applies to an association list.

If a search specification is:

  • Defined on a list, then Siebel CRM overrides any search specification that is defined on the business component.
  • Not defined on the list, then Siebel CRM uses the search specification that is defined on the business component.

How Siebel CRM Handles a Search Specification if Multiple Applets Are Involved

If two applets reference the same business component, and if these two applets are included in the same view, then Siebel CRM creates one query against the Siebel database to update these applets. A database SELECT statement only supports one WHERE clause, so the following conditions apply:

  • Only one of the applets can contain a search specification.
  • If multiple applets each contain a search specification, then each search specification on each applet must be identical.

For example, Siebel CRM displays the Account List Applet and the Account Entry Applet in the Account List View. In the Account Entry Applet, it displays the record that the user chooses in the Account List Applet. If the user chooses a different row in the list or scrolls through the list, then Siebel CRM updates the Account Entry Applet to make sure the same record is chosen in the Account List Applet. Siebel CRM enters data into these applets from the same query, so the applets display the same record set.

You must not define the same search specification on the business component and on the applet. If you do this, then duplicate joins might result.

If a view must include two applets that must not display master detail relationships, then make sure each applet references a different business component. If these applets reference the same business component, then Siebel CRM might synchronize them in the Siebel client because of links that it defines in the business objects.

How the Applet Visibility Type Property Affects a Search Specification

If the Applet Visibility Type property of the view web template item includes a value that is not null, then Siebel CRM might ignore a search specification that is defined for the applets in this view. It is recommended that you use this property for applets in a view that reference a different business component. If you use this property, then you must test it thoroughly.

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.

Configuring Siebel Business Applications Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Legal Notices.