function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
anantha Lakshmi kuppalaanantha Lakshmi kuppala 

Method does not exist or incorrect signature: void getLwcContacts() from the type dfsmlwccontroller

public class dfsmlwccontroller {
    @AuraEnabled(cacheable=true)
    public static List<Contact> getLwcContacts(string accountId){
        return [SELECT Id, Name FROM Contact WHERE accountId=:accountId];
    }
}
while running statement dfsmlwccontroller.getLwcContacts(); using debug open excute anonymos window getting

Line: 1, Column: 19
Method does not exist or incorrect signature: void getLwcContacts() from the type dfsmlwccontroller
PriyaPriya (Salesforce Developers) 
Hey Anantha,

As per the apex class, the method also accept the parameter 
public static List<Contact> getLwcContacts(string accountId)
So while calling or executing such method, you need to pass the parameter as well like below :- 
Account acc = [select id from Account limit 1];
dfsmlwccontroller.getLwcContacts(acc.Id);

Kindly mark it as the best answer if it helps you.

Thank you
 
ravi soniravi soni
hi @Shekhar Gadewar 144,
run this method by using following way.

Account acc = [select Id,name from Account limit 1];
dfsmlwccontroller.getLwcContacts(acc.Id);

let me know by marking it as best answer.
Thank you