You need to sign in to do that
Don't have an account?
fiona gentry
Anonymous apex unable to execute static method of class
Hi Folks,
I have a apex class which i am trying to execute via Developer console Anonymous apex
but getting the error as
Line: 1, Column: 28
Method does not exist or incorrect signature: void isAccountResearchcompleted(String, String) from the type ERTT_TaskCreationValidation
Here is Apex class for reference
Your response in appreciated
Regards
Fiona
I have a apex class which i am trying to execute via Developer console Anonymous apex
ERTT_TaskCreationValidation.isAccountResearchcompleted('01236000000OnsMAAS','01236000000OnsKAAS');
but getting the error as
Line: 1, Column: 28
Method does not exist or incorrect signature: void isAccountResearchcompleted(String, String) from the type ERTT_TaskCreationValidation
Here is Apex class for reference
public class ERTT_TaskCreationValidation { public static void isAccountResearchcompleted(List<Task> ERTTTasks,Set<Id> caseIdset) { map<id, Task> mapTaskDetails ; map<Id, Case> mapCaseWithTaskList = new map<Id, Case>([select id, (Select id, Action__c from Tasks ) from Case where Id in: caseIdset]); for(Task t : ERTTasks) { Boolean validationFlag = true; for(Task t1: mapCaseWithTaskList.get(t.WhatId).tasks) { if(t1.Action__c == 'Airtel Account Research') { validationFlag = false; } } if(validationFlag) { t.addError('Please Create a task for Airtel Account Research before creating any other Task'); } } } }
Your response in appreciated
Regards
Fiona
As Ankaiah mentioned, you're passing incorrect values to your method. Here's how it should look like:
Your method takes a list of Tasks as the first arguement and a set of Case Ids as the second.
All Answers
Your static method have list & Id parameters but you were passing strings for the both parameters.
You need to pass the List of tasks & case ids to the static method.
If this helps, Please mark it as best answer.
Thanks!!
Can you share me a sample how it should look like with sample List of tasks & case ids to the static method.
Thank you
Fiona
As Ankaiah mentioned, you're passing incorrect values to your method. Here's how it should look like:
Your method takes a list of Tasks as the first arguement and a set of Case Ids as the second.