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

learn more… | top users | synonyms

2
votes
1answer
31 views

SOSL Pagination

I am trying to implement pagination for SOSL search. It queries Accounts and Contacts. I thought of utilizing StandardSetController but it seems not possible with SOSL. Per documentation, SOSL can ...
1
vote
0answers
12 views

Access email subject and email body data in global search

I just noticed that in global search results, data mentioned in email body or email subject is not accessible for search results (SOSL) due to salesforce search limitations. Ref: ...
1
vote
1answer
42 views

SOQL query to get records from two independent objects

I have a requirement to create a report. I have three Objects : Contact, Order and Lead. Order is lookup to contact. Lead has no relation with any of these. I need to create a report with some ...
1
vote
1answer
13 views

Getting total records in SOSL query

Sorry if this is a basic query but I need to get total number of records while getting response of SOSL query. I had to use SOSL query as SOQL could not search large text fields or custom fields. So ...
-1
votes
2answers
38 views

How to get RecordType.Name from a lookup relationship - SOQL [duplicate]

I have a custom object called Employee and another object called Device Device is a lookup relationship to Employee object I'm trying to pull the Device RecordType.Name something like this: SELECT ...
3
votes
1answer
35 views

Find all records referencing a specific Account

What would be the best way to go about listing all the records that reference an Account? Lookup Ids aren't search indexed so SOSL turns up no results when looking for the Account Id and the only ...
1
vote
2answers
49 views

SOQL: Ability to search on multiple fields using Like

I'm looking a way to provide a user ability to search on multiple fields like the user can search on Name or Description or Make or Model etc.. I have the following code in my apex public ...
0
votes
1answer
14 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
19 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
46 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
64 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
75 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
88 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
76 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
120 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
63 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
34 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
178 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
343 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
235 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
155 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
63 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
68 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
88 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
88 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
613 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
461 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
124 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
115 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
534 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
252 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
134 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
441 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
102 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
186 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
65 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
342 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
247 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
209 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
105 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
119 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
63 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
99 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
123 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
251 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
2k 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), ...