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

learn more… | top users | synonyms

0
votes
1answer
12 views

Retrieve multiple Id from SOSL

I have some SF Id (18 char long) coming from a backup system and I have to check if they still exists. Is there a smarter way then do 3 SOQL? Maybe with SOSL? Something like: public static ...
0
votes
1answer
12 views

How to query on Category group to find all child or subcategories. ?

I have an issue. In knowledge base i have two Category groups, One is A and other is B. Now under A i have ALL--->Subcategories. Now i want to write a query which can get me all subcategories under ...
1
vote
1answer
42 views

Showing matching keyword sentences from SOSL/SOQL results

We have a requirement to search in large text area field (for e.g. Description). We are using SOSL for the same. While showing results on the VF page we want to only few sentence from Description ...
1
vote
2answers
55 views

Querying a field on an unknown object type

I have the ID of an object that could be either an account or a contact or a few other object types and want to query the name of the object regardless of the type and pass it to a string. I am ...
0
votes
1answer
40 views

Copy field values of one object to another object (Opp to Contract)

Hi Want to transfer the value from Opp to contract. Once Opp stage is CLOSED WON it is converted into New Contract. Req: Once Contract is created, i want to transfer/copy the same field values ...
0
votes
1answer
57 views

How to search for text in Rich Text area field in Apex

i want to search a text in Rich Text area field in a custom object. As We can't use the RichTextArea field in where clause to search records,i am looking for the way to search a text. Is there any ...
1
vote
0answers
75 views

SOSL query returns only 250 records event if there are more than 2000+ records present

I have two queries List<sobject> soslRecords1 = Search.query('FIND {I need help res*} in all fields returning Incident__c (id) where ID IN:rec_ids')[0]; List<sobject> ...
2
votes
3answers
81 views

FIND {query} with special characters failing with ampersand

FIND {tim/?jacob} parses perfectly fine when running the query. FIND {tim/&jacob} gives the following error: line 1:10 mismatched character '&' expecting '}'` what am I doing wrong? ...
3
votes
1answer
48 views

Interpreting wildcards (eg, * and &) in SOSL queries through the API. Escape or not?

I have a search feature that is implemented with the AJAX toolkit to use SOSL. var results = sforce.connection.search("FIND {" + sanitize(...) + "} IN NAME FIELDS RETURNING ..."); The ...
1
vote
1answer
31 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
153 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
271 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
187 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 ...
3
votes
1answer
129 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
59 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
61 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
74 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
72 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
490 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 ...
1
vote
2answers
356 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
121 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
101 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
442 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 ...
3
votes
1answer
214 views

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

Here is my code: public with sharing class SOSLController { public string srchobj {get; set;} public Map<String, EventPreferences__c> mapEventPref; public EventPreferences__c ...
2
votes
2answers
124 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
3
votes
1answer
393 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
94 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
176 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
1k 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
64 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
324 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
228 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
176 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
96 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
1k 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
54 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
115 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
61 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
93 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
121 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
221 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
1k 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
643 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
485 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
242 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
97 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
107 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
451 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 ...
5
votes
0answers
273 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, ...