You need to sign in to do that
Don't have an account?

Code error help.
Hello! Can someone help me figure out what is wrong with my Apex class? Thank you!
public class RelatedTasks {
Public static void taskmethod(){List<Task> tasks = [SELECT id, status from Task WHERE WhatId =:ApexPages.CurrentPage().getparameters().get('id') and status = 'Open'];}
for(Task t : tasks){
If(t.Status =='Open'){
boolean isOpen = true;
}
return isOpen;
}
}
and the error is the following:
Expecting '}' but was: 'for'
Thank you!
public class RelatedTasks {
Public static void taskmethod(){List<Task> tasks = [SELECT id, status from Task WHERE WhatId =:ApexPages.CurrentPage().getparameters().get('id') and status = 'Open'];}
for(Task t : tasks){
If(t.Status =='Open'){
boolean isOpen = true;
}
return isOpen;
}
}
and the error is the following:
Expecting '}' but was: 'for'
Thank you!
Hi Abby,
Please see the code below:
All Answers
Hi Abby,
Please see the code below: