Kindly assist in this challenge. I have executed the ContactAndLeadSearch Class code successfully without errors but encountered an error when Checking the Challenge though my debug window showed a successful compilation.
The problem and my debug window is shown below:
Create an Apex class that returns both contacts and leads based on a parameter.
To pass this challenge, create an Apex class that returns both contacts and leads that have first or last name matching the incoming parameter.
- The Apex class must be called ContactAndLeadSearch and be in the public scope
- The Apex class must have a public static method called searchContactsAndLeads
- The method must accept an incoming string as a parameter
- The method should then find any contact or lead that matches the string as part of either the first or last name
- The method should finally use a return type of List<List< sObject>>
- NOTE: 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
10 Antworten
The method should then find any account with rating hot or opportunity that matches the string as part of their name field in apex?