function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
RichardC.ax220RichardC.ax220 

Ajax API search for "Express" should return matching contacts, but returns empty string

I have an S-Control where I do the following SOSL search:

FIND {Express} RETURNING
Contact(Id,FirstName,LastName,Account.Name,Email,MailingStreet,MailingCity,MailingState,MailingPostalCode,Phone),
Lead(Id,FirstName,LastName,Company,Email,Street,City,State,PostalCode,Phone)

I expect to get two matching contacts from the standard sample data under the Account "Express Logistics and Transport", but instead the API returns an empty string. Entering Express in the Salesforce Search box correctly displays the account and two contacts. The same search in Apex Explorer 8.0 says "No results found." Submitting "FIND {Express}" in Explorer with an empty Return Field Spec returns the Account record.

My S-Control returns contacts in other accounts when I specify the account name. For example, I can FIND {United} with the return spec above and get all the contacts for the account United Oil & Gas. Why does it return only an empty string for Express?

werewolfwerewolf
Well, you mention that the word "Express" can be found in the account, but you're limiting your search scope to only Contact and Lead.  I don't think a SOSL search will find text from related objects.