You need to sign in to do that
Don't have an account?
Daniel Roberts
Illegal conversion from List to Contact
Hey everyone, trying to get my APEX skills up. Can't seem to figure out how to debug this error. Any advice?
Thanks,
Thanks,
public class ContactSearch{ public static Contact searchForContacts(String lastName, String zip){ List<Contact> conts =[SELECT Id, Name FROM Contact WHERE LastName=:lastName AND MailingPostalCode=:zip ]; return conts; } }
All Answers
Illegal assignment from List<Contact> to List<Contact>
public with sharing class ContactController {
@AuraEnabled(cacheable=true)
//public ContactController() {
//}
public static List<Contact> getContactList() {
/* return [
SELECT Id, Name, Title, Phone, Email
FROM Contact
WHERE Email != null
LIMIT 10
]; */
List<Contact> conts =[ SELECT Id, Name, Phone, Email FROM Contact WHERE Email != Null];
Return conts;
}
please help to find solusion