• Ashutosh Salgaonkar
  • NEWBIE
  • 20 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 0
    Replies
seeing this error in console.
and a parameter is not getting passed to AuraEnabled method while developing lightning Application
While developing a lightning component I wanted to access a sforce object FiscalYearSetting from Controller. Will it work when someone else uses my component?
 
Error:Executing the 'searchForContacts' method failed. Either the method does not exist, is not static, or does not return the expected contacts.

Code:
public class ContactSearch {

    public static List<Contact> searchForContacts(String lastName, String mailingPostalCode){
        List<Contact> contactList=null;

        contactList=[SELECT Id,Name from Contact where (Last_Name__c=:lastName OR MailingPostalCode=:mailingPostalCode)];
      
        return contactList;
    }
}