SOSL

,

One of the things you learned about SOQL is that all queries are based around a single Force Platform object. The Force Platform also offers another language that queries all objects in your organization, Salesforce Object Search Language, or SOSL

SOSL Syntax

The basic syntax for SOQL is as follows:

FIND {<search_term>} IN <search_group> RETURNING <field_spec>

The search_term is the string that is searched for. You can specify one or more strings or variables for this value. You join multiple strings together with an AND, a NOT or an AND NOT. All searches are case-insensitive, unless you use double quotes around the search_term to represent an exact string. You can also use double quotes to search for exact strings with spaces or punctuation marks. You can also use wildcards at the end or in the middle of a search_term: * for any number of characters, or ? for a single character.

The search_group allows you to specify the fields you want to search. You can search ALL FIELDS, the default,EMAIL FIELDS,PHONE FIELDS, or NAME FIELDS.

Finally, the RETURNING field_spec lists the objects that are returned from a SOSL query. You can list one or more objects in this clause, and each object can have a list of fields following the object name in parentheses.

If you want to return a list of users who have the same area code as a job applicant, the basic SOSL query you use looks like the following:

FIND :areaCode IN PHONE FIELDS RETURNING User(ID)

Since you cannot call SOSL from a trigger, you will not implement this functionality in your current trigger. For more information on SOSL, please refer to the Force Platform API Reference manual.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.217.101.72