+ Start a Discussion
Matheus SalesMatheus Sales 

How i execute this method ? - Newbie

public class ContactAndLeadSearch {

    public static List<List<SObject>> searchContactsAndLeads( String nome)
    {   
        List<List<sObject>> searchList = [FIND :nome IN All Fields RETURNING Contact(FirstName,LastName),Lead(FirstName,LastName)];
        return searchList;         
    }
}
SonamSonam (Salesforce Developers) 
You can directly call this function name:
searchContactsAndLeads(pass value to the variable)

reference:
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_classes_static.htm