public class ContactSearch {
public static List<Contact> searchForContacts(String lastName,String postalCode){
return [select LastName,MailingPostalCode from Contact
where LastName = :lastName and MailingPostalCode = :postalCode order by LastName,MailingPostalCode desc];
}
}
Please mark it as solved if my reply was helpful. It will make it available for other as the proper solution.
Please gow through https://trailhead.salesforce.com/en/modules/apex_database
if you need any assistanse, Please let me know!!
Kindly mark my solution as the best answer if it helps you.
Thanks
Mukesh
Below is the code which worked for me.
Please mark it as solved if my reply was helpful. It will make it available for other as the proper solution.
Best Regards
Sandhya