You need to sign in to do that
Don't have an account?

how can i slove the sosl problem
Hai guys.
i Have the following requirment.
The Apex class must be called 'ContactAndLeadSearch' and be in the public scope.
The Apex class must have a public static method called 'searchContactsAndLeads'.
Because SOSL indexes data for searching, you must create a Contact record and Lead record before checking this challenge. Both records must have the last name 'Smith'. The challenge uses these records for the SOSL search.
The return type for 'searchContactsAndLeads' must be 'List<List< SObject>>'
The 'searchContactsAndLeads' method must accept an incoming string as a parameter, find any contact or lead that matches the string as part of either the first or last name and then return those records.
as per above requirment i created the class
public class ContactAndLeadSearch
{
public static List<List< SObject>> searchContactsAndLeads(string s1,string s2)
{
list<contact> conlist = new list<contact>();
list<lead> leadlist = new list<lead>();
List<List< SObject>> ss = [Find 's1' IN ALL FIELDS Returning contact(lastname),lead(name,company)];
conlist =((list<Contact>)ss[0]);
leadlist = ((list<lead>)ss[1]);
return null;
}
}
and i getting the following error
Executing the 'searchContactsAndLeads' method failed. Either the method does not exist, is not static, or does not return the expected search results.
please help me any one
i Have the following requirment.
The Apex class must be called 'ContactAndLeadSearch' and be in the public scope.
The Apex class must have a public static method called 'searchContactsAndLeads'.
Because SOSL indexes data for searching, you must create a Contact record and Lead record before checking this challenge. Both records must have the last name 'Smith'. The challenge uses these records for the SOSL search.
The return type for 'searchContactsAndLeads' must be 'List<List< SObject>>'
The 'searchContactsAndLeads' method must accept an incoming string as a parameter, find any contact or lead that matches the string as part of either the first or last name and then return those records.
as per above requirment i created the class
public class ContactAndLeadSearch
{
public static List<List< SObject>> searchContactsAndLeads(string s1,string s2)
{
list<contact> conlist = new list<contact>();
list<lead> leadlist = new list<lead>();
List<List< SObject>> ss = [Find 's1' IN ALL FIELDS Returning contact(lastname),lead(name,company)];
conlist =((list<Contact>)ss[0]);
leadlist = ((list<lead>)ss[1]);
return null;
}
}
and i getting the following error
Executing the 'searchContactsAndLeads' method failed. Either the method does not exist, is not static, or does not return the expected search results.
please help me any one
Let us know, if you need any help.
The Apex class must be called 'AccountHandler' and be in the public scope.
The Apex class must have a public static method called 'insertNewAccount'.
The 'insertNewAccount' method must accept an incoming string as a parameter, name the account after the parameter, insert it into the system and then return the account record.
The 'insertNewAccount' method must also accept an empty string, catch the failed DML and return null.