Using the EXISTS Operator with a Primary

If 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:

  • Includes EXISTS. The query results include every record in the multivalue group that matches the search specification.

  • Does not include EXISTS. The query results include every primary record in the multivalue group that matches 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:

NOT EXISTS(*)

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:

VSILVER

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.