Bookshelf Home | Contents | Index | PDF |
Siebel Developer's Reference > Operators and Expressions > Operators > Using the EXISTS Operators with Multivalue GroupsThis topic describes how to use the EXISTS operator with multivalue groups. Using the [NOT] EXISTS Operator with Multivalue GroupsTo reference a multivalue group field, you can specify the [NOT] EXISTS operator in a query by example or in the Search Specification property of an object. Siebel CRM uses a multivalue group field to display the child records of a parent record in the parent record applet. For example, assume the following:
Assume you set the search specification for the opportunity name to the following value: In this example, the Opportunity business component returns all opportunities that contain a name of Wine Festival. Assume you set the search specification for the contact last name to the following value: In this example, the Opportunity business component returns all opportunities that include a contact with a last name of Smith. This situation occurs because you defined the search specification on the Opportunity business component and not on the Contact business component. Examples of Using EXISTS and NOT EXISTSA query by example that resides in the last name field in the client must use the following format: A predefined query where the Opportunity is the business component must use the following format: Opportunity.Search = "EXISTS ([Last Name] = ""Smith"")" A search specification that resides in the Search Specification property of the business component or applet must use the following format: EXISTS ([Last Name] = 'Smith') The following example chooses records according to multiple child and grandchild criteria. It defines a more complex query and demonstrates that a query can use all the business components involved in the view without specifying the business component that contains the field: EXISTS ([ChildField1] = 'X' AND [ChildField2] = 'Y') EXISTS ([GrandchildField1] = 'A' AND [GrandchildField2] = 'B') You can add NOT in front of EXISTS to query for everything other than the value that you include after EXISTS. Using the EXISTS Operator with a PrimaryIf a multivalue field includes a primary ID field, and if the Use Primary Join property of the Multi Value Link that this multivalue field references contains a check mark, and if the search specification:
If you do not specify a primary ID field for the multivalue group, or if the Use Primary Join property does not contain a check mark, then the query must include EXISTS. If you specify a query that does not use EXISTS, then the object manager automatically inserts EXISTS as part of the search specification. If the field value for a child record is empty, then the object manager uses the EXISTS clause to get the parent record. It does not get any parent record that does not include a child. You can use the following code to query for parent records that do not include a child: To query a multivalue group, Siebel CRM specifies a value for a multivalue group or multivalue field for the primary value, by default. For example, if you use the following value to query the Account Team, and if the multivalue group supports a primary, then Siebel CRM returns all records that contain VSILVER as the primary position on the team: If a view includes sales team visibility, then you must not use query by example to constrain the account team. Instead, you can use a view that includes the All visibility filter. For example, assume you log in as SADMIN, navigate to the My Accounts view, and then query the Account Team with a login name, such as VSILVER. In this situation, Siebel CRM does not return all accounts where SADMIN is on the team and VSILVER is the primary. |
Siebel Developer's Reference | Copyright © 2018, Oracle and/or its affiliates. All rights reserved. Legal Notices. | |