SOSL the Salesforce Object Search Language syntax. Use this tag for questions related to SOSL and handling query ouput.

learn more… | top users | synonyms

1
vote
1answer
14 views

how to find a word in url column in a given object

I am looking for SOQL/SOSL to find records in object having a URL column with some filter(text in column( on URL column, tries like and sosl, both doesn't work. Any help ?
1
vote
1answer
104 views

Getting SOQL/SOSL Injection error when I send my code for security review

I have send my code for security review I am getting error for SOQL/SOSL Injection. I have made the changes on the bases they have mention in report. But even I am getting issue with dynamic soql I am ...
2
votes
1answer
102 views

How to query on OData(External Object) in Visualforce search page. using search string

I am trying to write a query on External Object using LIKE operator but its showing as error like, it is limited to use LIKE operator for OData Query. Is there any alternate way of querying? SELECT ...
0
votes
0answers
46 views

How to query for articles without a data category?

I can query articles with specific data categories, for example: SELECT Title FROM KnowledgeArticleVersion WHERE PublishStatus='online' WITH DATA CATEGORY Geography__c ABOVE usa__c But what if I ...
1
vote
1answer
68 views

SOQL: Bulk Fuzzy Searching

I have a list of accounts that I would like to perform a LIKE query on. Ideally, my query would be something like: SELECT id, owner.name FROM Account WHERE name LIKE IN :entityList Is there any way ...
0
votes
1answer
43 views

SOSL not work correctly?

Has anyone meet the problem that the SOSL query result does not as the expectation? One of our customer met the problem that the search result is much less than what it should be, than I ran the ...
0
votes
0answers
44 views

Search and filter articles by the content on a file field

following this question (What fields are searched in Articles?) I'm able to filter articles successfully in the Knowledge tab by doing a search with key-words that are inside the content of the files ...
1
vote
1answer
49 views

Function to properly escape dynamic SOSL input

I have a page that allows users to specify a search term that then gets put into a SOSL Query. Obviously I'm escaping single quotes to prevent injection, but certain input still cause my code to ...
0
votes
0answers
42 views

SOSL in Test class always returning empty

I have the below class @isTest private class SOSLTestClass { @isTest static void test_method_one() { Account accObj1 = new Account(Name='test'); Account accObj2 = new ...
1
vote
2answers
245 views

SOSL issue, assistance requested

I'm a newbie to apex and am having issues completing the challenge on Trailhead. Can someone assist? Create an Apex class that returns both contacts and leads based on a parameter. With SOSL you ...
0
votes
1answer
169 views

SOSL Question Problem

With SOSL you can search against different object types that may have similar data, such as contacts and leads. To pass this challenge, create an Apex class that returns both contacts and leads that ...
3
votes
1answer
112 views

Does SOSL use Caching?

I'm trying to re-factor a trigger because it is operating on a Contact Record type that contains more than 100,000 objects. I easily switched over to the SOSL equivilant, but now my code is behaving ...
1
vote
1answer
72 views

How to query all records changed since date?

Is there a way to query all records of all object types changed since a given date? SOQL doesn't appear to have a way to do this. I thought that the "From" clause might have a way, but when I tried ...
1
vote
2answers
241 views

Query Salesforce to find any records created in past “X” hours

My organization does monthly deployments from our sandbox to production that include bug fixes and enhancements. When we deploy to production, we do testing to make sure that everything is working as ...
2
votes
1answer
139 views

In SOSL Query I want to retrieve the records from the object which is given in custom settings?

here is my code: Page: <apex:page controller="SOSLController"> <apex:form > <apex:inputText value="{!searchStr}"/> <apex:commandButton value="Search in Account, Contact, ...
2
votes
2answers
95 views

How to Query what Salesforce SObjects a user has access to

Please suggest How to Query what Salesforce SObjects a user has access to ? Based on this i want to give access to user on particular apex tab menu . Thanks
2
votes
1answer
264 views

SOQL on Rich text fields long text

I'm working on a custom search page, which will search through the fields of the Project object. I use dynamic SOQL query similar to that: SELECT Id, Name, Link_Test__c, ...
3
votes
1answer
75 views

SOQL Query returns results, however written in SOSL it returns nothing

I am trying to find contacts by Phone number. I require using SOSL due to it's search excluding non-alphanumeric chars but cannot get the same (or any) results from SOSL as I can from SOQL. I am using ...
3
votes
0answers
133 views

regEx + search capability in sfdc platform

Looking for suggestions on accomplishing search + regEx in sfdc, to search cases which have occurrence of the phrase 'PROVIDED BY:' in case history and get the case number where this phrase was found ...
1
vote
1answer
720 views

Retrieve data from custom object on Visualforce page

I have created a custom object which contains multiple fields that I want to be able to show on a Visualforce page. From the discussion I've had with another developer it was recommended that I use a ...
3
votes
1answer
56 views

how to add a value from a text box to SOSL querry dynamically?

I have written an sosl querry. for(List<SObject> obj:[FIND **'jose'** IN ALL FIELDS RETURNING Lead(id,name,Company,Phone,Street,City,State,PostalCode,Country,Owner.id WHERE ...
1
vote
2answers
268 views

404 error when making SOSL queries from native mobile applications

I am developing a native android app using the mobile sdk. I am trying to make a search query like this RestRequest req = RestRequest.getRequestForSearch("v20.0", "FIND {"+searchString+"*} IN ALL ...
0
votes
0answers
22 views

Report on opportunities with certain activities?

How would I create a report that showed all opportunities with at least one activity, whose most recent activity was this month, and contained the word "foo"? (I'm a total SFDC novice -- if there are ...
0
votes
1answer
138 views

unexpected response 404 on getRequestForSearch

I am developing a native android app using the mobile sdk. I am trying to make a search query like this RestRequest req = RestRequest.getRequestForSearch("v20.0", "Find '"+searchString+"*' IN ALL ...
2
votes
1answer
118 views

Can SOSL retrieve child objects from the result set of parent objects?

I have contact object and Registration Custom Object. I want to list the registration object fields in contact object using relationship as follows: SELECT id, name, (SELECT id,name FROM ...
3
votes
1answer
74 views

Is there a way to catch the “Search Unavailable” exception that is thrown when doing a SOSL query?

We have a try/catch block around the line doing the query, but we still get this exception mailed to us on some SOSL queries: List<List<SObject>> ret, queryResult; try { ...
0
votes
1answer
688 views

Display list of list on visual force page. Search results of inputtext from all objects using sosl

I am trying to search for a text from all the objects. The method in the controller returns the results as List of List. I am trying to display the results in the visualforce page but no results get ...
2
votes
0answers
48 views

SOSL unusual behaviour

I have faced and have been facing issues using the SOSL query or I may say SOSL query confuses me every time with its result/output. i have encountered situations when the SOSL search query doesn't ...
4
votes
1answer
110 views

Filter results with not like

I have to query task object to get the rows with subject not starting with 'Email' . I have tried the given query. But it is not working . Please suggest. select status, subject, whatId from task ...
0
votes
1answer
44 views

SOSL search result in c# for salesforce integration

I have used the SOSL to get the salesforce record. SOSL search result in c# for salesforce integration?
0
votes
2answers
76 views

How to use SOSL in c# for salesforce integration

I have used the SOQL to get the salesforce record. sforce.SforceService SFDCSer; qr = SFDCSer.query('select id,name from account'); sforce.sObject[] queryresutls = qr.records; ...
4
votes
1answer
117 views

Can we Scan more than 50000 record using SOSL query

As mentioned in Salesforce doc that it can return 2000 records but what about scanning 500K records. Is there any limit on records that will be scanned.
4
votes
2answers
162 views

SOSL Queries returning empty lists

When you do a SOSL query - the result is in the form of multiple lists (one for each object you search). List<List<sObject>> resultsList = [FIND 'test' IN NAME FIELDS RETURNING ...
2
votes
1answer
601 views

SOSL Statement Example

Can someone please explain what the following query does..? List<List<sObject>> results = [FIND '4155557000' IN Phone FIELDS RETURNING Contact(Id, Phone, FirstName, LastName), ...
3
votes
2answers
471 views

What's the correct syntax for this SOSL sent via the REST API?

I'm trying to retrieve an Id from Salesforce over the REST API using SOSL. My query which I can execute without issue in the Developer Console is: FIND '(415)901-7000' IN PHONE FIELDS RETURNING ...
1
vote
1answer
372 views

Is there a way to search a long text area for contains string in SOSL

I have a request for fix a typo in a long text area. So it might be worthwhile for me to search for the same typo for all the objects of that type. Since SOQL can't filter on long text area, I guess ...
7
votes
2answers
201 views

Duplicate IDs in sandbox - how come?

We've been struggling with an internal server error if the SOSL search text is test: List<List<Account>> accounts = [FIND 'test' IN ALL FIELDS RETURNING Account(Name, Description, ...
3
votes
2answers
83 views

How to get a list of sidebar fields programmatically?

Is there a way to programmatically determine which fields of an object are searched during sidebar search? Also, for custom objects, how does Salesforce decide which fields should be searched?
0
votes
1answer
88 views

Need Better Search Conditions on Duplicate VF Page [closed]

I have an apex class that brings up duplicates when a user enters in an account name in the search box on the visualforce page. Right now, the search takes the exact letters written into the search ...
6
votes
2answers
363 views

Sanitize a string before injecting it into SOSL

Is there a way through the .net framework or some other package to sanitize strings so that they can be safely used in sosl? Is there any larger standard that SOSL falls under? I was able to find How ...
4
votes
0answers
235 views

Can SOSL perform full text search on chatter files?

The Document sobject has an IsBodySearchable flag which controls if you can full text search it via SOSL. ContentVersion has no such flag but I know that it is searchable in certain cases. However, ...
1
vote
1answer
377 views

Problem with WHERE Clause in SOSL to search KnowledgeArticles

I am trying to search case,solution and KnowledgeArticles with following SOSL FIND 'lithium' RETURNING Dissusion__kav (Title, Summary, LastPublishedDate, KnowledgeArticleId, UrlName WHERE ...
3
votes
1answer
527 views

SOSL FIND verses SOQL WHERE

Is there any way to convert SOSL Find clause into SOQL where clause ? For example following SOSL and SOQL both have same filter criteria. SOSL: FIND {'ABC' and 'XYZ'} IN ALL FIELDS Returning ...
2
votes
1answer
175 views

Field level security and UI search / API search

I have noticed that if I use field level security to hide a field for a custom profile, a user in the profile can still global search for text in that field and the record will appear in the results, ...
5
votes
6answers
756 views

Most efficient (instant / no Batch) way to mark thousands of records as dirty

I have the requirement to store and retrieve the information that a set of arbitrary sobject records are "dirty" and need to be touch by asynch processes. I am talking about 10.000 to 100.000 records ...
4
votes
1answer
816 views

Escaping reserverved characters in SOSL queries

Escaping reserverved characters with backslash as described in Force documentation (http://www.salesforce.com/us/developer/docs/soql_sosl/Content/sforce_api_calls_sosl_find.htm) give unexpected ...
6
votes
1answer
389 views

Clarification on Unit Testing a method that runs a SOSL query

I have a controller method that uses a SOSL query to generate a list of options. It works when used in the VF page, but the unit test is failing; logging shows the SOSL query is returning no results. ...
6
votes
3answers
694 views

How do I SOSL across objects, matching all records with FIND clause?

To all the expert SOSL gurus lurking out there, I thought this will be an interesting one: I have some SObjects of different types and I want to return their Name values in a single query. In ...
0
votes
2answers
751 views

How to Search contacts using wildcard characters(*,%,?) in salesforce

Please give me answer for "How to Search(box) list of contacts using wildcard characters(*,%,?) in salesforce "
4
votes
3answers
506 views

SOSL returning maximum of 500 records

I am using SOSL to search records in Salesforce. According to document http://www.salesforce.com/us/developer/docs/soql_sosl/Content/sforce_api_calls_sosl_limit.htm, It should return 2000 records but ...