Questions tagged [sosl]

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

Filter by
Sorted by
Tagged with
0 votes
0 answers
18 views

can I create SOQL or SOSL command to get content of a report?

I know nothing about SF. I want to get content - preferably as .csv - or a report that someone created for me. I do not have SF account. I have access to an integration account that I managed to ...
0 votes
0 answers
20 views

What does SOSL's "Update Tracking" actually update?

The SOSL Documenation's Update an Article’s Keyword Tracking with SOSL page states: Track keywords that are used in Salesforce Knowledge article searches with the UPDATE TRACKING optional clause on a ...
1 vote
0 answers
40 views

SOSL Problem - Unexpected Results

I'm doing a parameterized search, but unfortunately I'm getting strange results. I've added a long text field that, using a flow, is populated with the contents of a group of important fields: Project ...
1 vote
0 answers
73 views

Does filtering in lightning-record-picker support SOSL?

I am using the lightning-record-picker component and I am querying an object which has its 'Name' field encrypted. This means that I'm returning a 'the like operator is not supported on an encrypted ...
3 votes
1 answer
2k views

Using encrypted fields in SOSL query gives in 0 results

My org has Classic encryption and I have a encrypted field in contact object. I am trying to use that field in SOSL. FIND {123456789} IN ALL FIELDS RETURNING CONTACT(NAME) This is returning 0 ...
2 votes
2 answers
1k views

SOSL not returning record in test

I have EditorModalController.searchDoctors that returns a list of contacts. public class EditorModalController { @AuraEnabled public static List<Contact> searchDoctors(String ...
2 votes
1 answer
126 views

SOSL query the encrypted text field is possible but NOT in Apex test class?

I created an classic encrypted text field called "encryptedPIIData__c" in User object and added the User data. I created a function that is able query out via SOSL based on the encrypted ...
0 votes
0 answers
98 views

Performing Fuzzy search by using multiple keywords, on a specific long text area field which has keywords, hashtags on a custom object

I have a requirement to perform fuzzy search on a specific long text area field on a custom object and return the results, where long text area field can have some keywords, hashtags or quantity of ...
3 votes
1 answer
2k views

System.UnexpectedException: Search unavailable thrown while deploying to prod

I am getting the following error while deploying to production: System.UnexpectedException: Search unavailable when executing a SOSL search within my test class at the line where I'm doing the ...
0 votes
0 answers
39 views

SOSL Returning incorrect result

We have one Unit Object and it has Description Text Field 255 char. Unit Object has 50 records with '48" Test Description' As a value in description__c field. Now We have SOSL Query as below, ...
0 votes
0 answers
42 views

SOSL Trailhead Challenge Issue

I'm new to salesforce but learing a bunch. I'm working on the SOSL challenge. My code is returning the correct data (I think) but I still fail the challenge. Any guidance would be super appreciated. ...
3 votes
1 answer
161 views

SOSL Find query not returning Standard Profiles, only Custom

Hello! I have a lookup component that uses a dynamic query based around FIND. It works great except when querying Standard Profiles. If I search for profiles, only custom profiles are returned. ...
3 votes
1 answer
3k views

SOSL Multiple Search Words

Trying to search multiple terms in SOSL in APEX. I tried this singular, of course works: [FIND 'searchOne' IN ALL FIELDS RETURNING ACCOUNT] But these don't work: [FIND 'searchOne' OR 'searchTwo' .......
0 votes
1 answer
77 views

Run SOSL without any search term

I have read the documentation for SOSL and have a usecase which is not explicitly mentioned anywhere. I can not use SOQL as it takes over 15 seconds. We have some non-index fields and wild cards ...
0 votes
0 answers
47 views

How are snippets generated when searching Knowledge Articles with SOSL and including the WITH SNIPPET keyword?

My user has admin profile and I made sure that I have at least read access on all fields on Knowledge__kav object. When I execute the below query in Developer Console I often do not get any snippets ...
0 votes
0 answers
46 views

SOSL email search is unable to locate a record in Salesforce immediately after the record has been saved (AWS and Salesforce)

I am using 2 platforms to do Extract , Transform, Load (ETL): Salesforce (SF) AWS I need to ingest taxonomy CSV files based on specific campaigns - called MVIs - into Salesforce. There are ...
3 votes
2 answers
1k 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 { ...
-1 votes
2 answers
600 views

How can I find a value in all fields using SOSL?

I want to find if any records have a value "Test123" How could I do this using SOSL and Apex? I tried this: List<List<SObject>> l = [FIND 'test123' limit 10]; But it throws an ...
10 votes
1 answer
7k views

SOQL query to fetch records with reserved characters ('*', '/', '(', ')')

Hoping there is a simple answer that I am overlooking. Currently, we are able to search for the following reserved characters with an escape sequence, eg a backslash character '\', in SOSL: & | ! ...
0 votes
0 answers
60 views

'includes' search behavior on SOSL

Reading about 'includes' filter on SOSL I have a question: What happens if I do: ...MyCustomField__c includes ('valueA,valueB') ? What i know:. If I do: ...MyCustomField__c includes ('valueA;valueB') ...
0 votes
1 answer
3k views

SOSL syntax to search from all objects

I need to create a custom search on Lightning Component where I should be able to search the text from all the objects through SOSL. I followed the module on trailhead and was able to create a custom ...
0 votes
0 answers
187 views

Is there a way to fetch the query plan for or insights about any specific SOSL execution?

Is there an alternate way to fetch the query plan of a SOSL execution (other than thru Developer Console > Query Editor)? My objective is to get some insights about any specific SOSL execution (...
0 votes
2 answers
3k views

SOQL: How to query records based on CreatedDate?

From the opportunity object, using SOQL, I want to query records which have been created x days (say 30 days) before today. I have written the following code: List<Opportunity> oppList = [SELECT ...
0 votes
1 answer
520 views

How to query Master object record only if they have a child record associated to it?

I want to filter out the contacts only if they have at least 1 serviceContract associated to it ? I know this is possible using apex ( query all childs in inner query and iterate through using .size() ...
1 vote
1 answer
301 views

Does SOSL work when there is a criteria for filtering the searched object through a lookup?

I have a SOSL query that queries on three different objects. A standard and two custom objects. After implementing the WHERE clause the query on the standard object is the only part that works. When I ...
0 votes
1 answer
186 views

Getting Error at Query: SOQL SOSL Injection while using checkmarx scan

global void execute(Database.BatchableContext BC, List<sobject> referenceRecords) { try{ List<Connection_Custom_Setting__c> connection = [select Id, ...
0 votes
1 answer
433 views

I want to add no of count of task on lead

There are 2 fields in the lead object ,total_count__c is for count the total no of task on the lead and in the No_of_Call_Count__c i want only those task whose subject contains 'Call' in the subject ...
0 votes
1 answer
105 views

Unpredictable behavior while escaping special characters in sosl

According to SOSL reference here ? & | ! { } [ ] ( ) ^ ~ * : \ " ' + - are reserved characters and need to be escaped by \ I have a rather simple dynamic SOSL Query for searching inside ...
0 votes
1 answer
167 views

How to resolve SOQL SOSL Injection security error

I am fairly new to salesforce. I am getting the soql sosl injection error in the below method while doing query. How to resolve this error? public static Days_Unavailable__c getAvlRecordById(String ...
2 votes
1 answer
248 views

SOSL Alphanumeric Search String Behavior, solution using %

I'm trying to understand some SOSL behavior. I had an issue where I needed to do a SOSL search using alphanumeric search strings. EX: 'blue1' We found that attempts to search using alphanumeric data ...
3 votes
4 answers
4k 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 ...
2 votes
1 answer
7k views

SOSL query searching in multiple fields

I want to search in multiple fields using SOSL. I know that it allows to search in all fields using below syntax- FIND {"Smith"} IN ALL FIELDS RETURNING contact (name), lead (name) And also works ...
3 votes
4 answers
66k views

How to query child to parent

How to query child to parent like contact to parent..and how to query master lookup relations. select id,lastnam,(select id,name from account where accountid=conatctid)from contact
-2 votes
1 answer
124 views

How can I show the Result with the trigger that I created?

So, I'm studying Apex Triggers in Salesforce with a practical exercise. As long as I was developing the exercise, I thought at my logical code, but when I tested the components, I had a problem with ...
0 votes
1 answer
312 views

How to use WHERE clause in SOSL query

I am trying to use the existing LWC with some modifications to get records on the basis of RecordType.Id but it's throwing an error instead. System.QueryException: expecting a right parentheses, found ...
0 votes
2 answers
728 views

Can you look for record ID's using SOSL?

I'm trying to play around with SOSL and was wondering is it possible to look for record ID's using SOSL? I tried FIND {0D56F0000DPRLnKSQX} IN ALL FIELDS RETURNING FeedItem(id,body) But it comes back ...
1 vote
1 answer
2k views

How to return List of a list in Apex Rest Get Method Using SOSL

I tried make this restapex code, and tried to using SOSL to find value this is my apex code when i used SOQL and it works well. @RestResource(urlMapping='/Account/*') global with sharing class ...
-3 votes
1 answer
65 views

Illegal assignment from List<String> to List<Order> (4:21)",

Im having this issue which I dont understand. Any advice?
1 vote
1 answer
224 views

Can I use SOSL to identify all records with a certain lookup value?

What happened: someone incorrectly merged two contacts. A host of related objects had lookups populated to these two contacts. When the contacts merged, all those objects were updated to all point to ...
0 votes
0 answers
250 views

What should be used to search a string across multiple fields of a single object? SOQL or SOSL

I want to search records for a particular object based on filter string that can match multiple fields on that object. This can be achieved via both SOQL and SOSL: SOQL : using like operator, applying ...
3 votes
0 answers
378 views

Bind Variables and Inconsistent Results in SOSL

I have some Apex code that does a SOSL query. If it uses bind variables, some users don't get results. If I build the query with string concatenation, then the results are consistent across users. ...
3 votes
1 answer
1k views

How to get list of all sobject records modified today in the system?

I need a list of all sobject records that got modified today. this is not just for one object but for all objects in the system. Is there a simpler way to do this?
0 votes
0 answers
160 views

Need help in putting not equal to field in SOSL in Salesforce

I have created the below SOSL for my Apex class as per the req to return the queried valued from the data base , but i am not able to put the not equal to operator in below SOSL, i have tried the ...
-2 votes
2 answers
97 views

because you can't populate a map with lists of lists

trying to populate a map with a list list like this: map<integer , listlist<<sobject>>> mpsosl=[find ' ba' IN all Fields RETURNING contact(name)]; error:Illegal assignment from List&...
1 vote
1 answer
541 views

Why is "you must specify a language where clause for knowledge articles in this API version" error occurring on API version 51?

I have SOSL queries in my Apex which work well on Knoledge__kav object. When running test classes I receive the "you must specify a language where clause for knowledge articles in this API ...
0 votes
2 answers
13k views

SOQL quey to get page layouts Names for perticular object

Requirement:I need to find How many page layouts(Name) for particular Object using SOQL query or any other method,because I have 500 objects so i cannot check manually.Please suggest How can i ...
0 votes
1 answer
2k views

SOSL use FIND with bind list of Strings - Specified search expression can not be converted to string

I have a list of strings (phones) which I'm trying to use inside my SOSL Find clause and its giving me issues: List<String> phonesList = new List<String>(); for(Account acc : acclist) { ...
4 votes
1 answer
1k views

SOSL Query against Custom setting object

I am experiencing some inconsistent behavior. On one org - I'm doing a SOSL (Search Query) against a custom setting and it works fine. But on a different org - I get entity type My_Custom_Setting__c ...
4 votes
1 answer
117 views

What really happens when a SOSL SearchQuery is longer that 4000 characters?

According to the SOQL and SOSL Reference page on FIND {SearchQuery}: If the SearchQuery string is longer than 10,000 characters, no result rows are returned. If SearchQuery is longer than 4,000 ...
1 vote
1 answer
213 views

How can I get Record Type, Link and Name of child records from a SOSL search?

I am building a small lightening component that on input search it should return account record names alongside contact record names alongside their types if they are account of contact and a link to ...

1
2 3 4 5
7