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
Zeel ShethZeel Sheth 

Method does not exist or incorrect signature: void verify(String)

hii,

how to resolve Method does not exist or incorrect signature ?

my code:
public class VerifyAccountcls {
 @AuraEnabled
    public static void  verify(List<String> recordid){
        List<Account> acclist = new List<Account>();
        for(Account acc:[select Id, Name, Phone, Website,
                    BillingStreet, BillingCity,
                         BillingState, BillingPostalCode, Verified__c from Account where Id in :recordid]){
                             acc.Verified__c = true;
                             acclist.add(acc);
                         }
        if(acclist.size()>0){
            update acclist;
        }
        
    }
@AuraEnabled
    public static void  unverify(List<String> recordid){
        List<Account> acclist = new List<Account>();
        for(Account acc:[select Id, Name, Phone, Website,
                    BillingStreet, BillingCity,
                         BillingState, BillingPostalCode, Verified__c from Account where Id in :recordid]){
                             acc.Verified__c = false;
                             acclist.add(acc);
                         }
        if(acclist.size()>0){
            update acclist;
        }
        
    }

}

thanks in advance,
Zeel
Best Answer chosen by Zeel Sheth
CharuDuttCharuDutt
Hii Zeel
Refresh THe Dev Console Ans Try Agian Calling It
Try Calling As Below
VerifyAccountcls.verify(new List<String> {'Account Id Paste Here'});
VerifyAccountcls.unverify(new List<String> {'Account Id Paste Here'});
Please Mark It As Best Asnwer If It Helps
Thank You!

All Answers

Sai PraveenSai Praveen (Salesforce Developers) 
Hi Zeel,

I dont see any issue in the class while saving. Can you confirm is there any issue in calling the method or where exactly are you facing the issue.

Thanks,
 
Zeel ShethZeel Sheth
yes I get an error when calling this method.
Sai PraveenSai Praveen (Salesforce Developers) 
Hi Zeel,

Can you confirm how you are calling this method and what are the parameters you are giving while calling the method?

Thanks,
 
CharuDuttCharuDutt
Hii Zeel
Refresh THe Dev Console Ans Try Agian Calling It
Try Calling As Below
VerifyAccountcls.verify(new List<String> {'Account Id Paste Here'});
VerifyAccountcls.unverify(new List<String> {'Account Id Paste Here'});
Please Mark It As Best Asnwer If It Helps
Thank You!
This was selected as the best answer
mukesh guptamukesh gupta
Hi Zeel,

Due to calling time of verify method you need to send List of string like below:-

Here you need to pass list of Account Ids to verify method
 
VerifyAccountcls.verify(new List<String> {'0010K00001u3MmdQAE,0010K00001u3MmdQAE'});
VerifyAccountcls.unverify(new List<String> {'0010K00001u3MmdQAE,0010K00001u3MmdQAE'});

if you need any assistanse, Please let me know!!

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

Thanks
Mukesh