You need to sign in to do that
Don't have an account?
Sandeesh
SOSL query
Currently i want to find all the ConvertedOpportunityId's from Lead Object using SOSL query:-
String queryString;
String searchdialog = 'New York'
queryString = 'FIND \''+searchdialog+'\' IN ALL FIELDS RETURNING Lead(ConvertedOpportunityId where isConverted = true)';
List<List<Lead>>resultset=search.query(queryString);
But i am unable to get the rows.
Thanks in Advance,
Sandeesh
Hope this will resolve your problem.
http://forceguru.blogspot.com/2011/01/inquery-behaviour-with-sosl.html
Thanks
Ankit Arora
Blog | Facebook | Blog Page
@ ankit '
i just visted ur blog. where u had explined that the it searces in first 200 records? then what is the sol if i need to serch only one particluar record. ?
will it not be returned if its not with in 200 records?
So can you explain this.
Hi,
I have just explained the native behavior of SOSL in salesforce. First 200 records for the SOSL is fetched out after that criteria is implemented on the results.
Thanks
Ankit Arora
Blog | Facebook | Blog Page
so if i want some partucular reocrd with some particular id then how should i frame my sosl then?
In my case there are hardly 20 records..Still I m not getting the list of rows.
That's strange, then you have to try the below options :
1) Use Databse.Execute instead of search.query
2) Try running your SOSL in system logs, does it return any results?
3) Use double quotes instead of single quotes -: queryString = 'FIND \"'+searchdialog+'\" IN ALL FIELDS RETURNING Lead(ConvertedOpportunityId where isConverted = true)';
Thanks
Ankit Arora
Blog | Facebook | Blog Page
While your syntax is correct, you aren't getting any results as you are trying to access converted leads. Once a lead is converted, according to the help it is no longer visible outside of reports.
I've tested this by creating two leads with 'Test' in the name and converting one of them. When I run a SOSL search on this, I only get the unconverted lead in the search results.
hey Bob,
I am able to access the ConvertedOpportunityid(using Soql though) , which is a field of lead Object even after converting the particular Lead.
I wonder whether it works with SOSL ???
You can access this fine via SOQL - converted leads aren't treated any differently. SOSL excludes them as otherwise you could end up with lots of matches that aren't relevant as the leads were converted some time ago.