You need to sign in to do that
Don't have an account?
Method does not exist or incorrect signature: void query(String) from the type Search at line 12 column 45
Hi Folks,
Error : Method does not exist or incorrect signature: void query(String) from the type Search at line 12 column 45
Please help me.
Apex Class: -
public with sharing class TestSOSLController {
Public List<account> accList{get;set;}
Public String searchStr{get;set;}
Public TestSOSLController(){
}
Public void soslDemo_method(){
accList = New List<account>();
if(searchStr.length() > 1){
String searchStr1 = '*'+searchStr+'*';
String searchQuery = 'FIND \'' + searchStr1 + '\' IN ALL FIELDS RETURNING Account (Id,Name,Type,Rating,Phone)';
List<List <sObject>> searchList = search.query(searchQuery);
accList = ((List<Account>)searchList[0]);
if(accList.size() == 0){
apexPages.addmessage(new apexpages.message(apexpages.severity.Error, 'Sorry, no results returned with matching string..'));
return;
}
}
else{
apexPages.addmessage(new apexpages.message(apexpages.severity.Error, 'Please enter at least two characters..'));
return;
}
}
}
Please check once any existing class in your org with a name search.If there please remove or rename it.
So your problem will solve.
Hope this helps,
Thanks
Varaprasad
I have changed name of Search with Searching and i did cross verified in Existing classes But Same error am recieving while compile.
Please help.