You need to sign in to do that
Don't have an account?
error info "Save error: unexpected token: ')' "
Hello,
I am attemping to create a warning email via apex class.
And I got a sample from internet for that.
But when I try that in my environment, I keep getting the error info "Save error: unexpected token: ')' ".
Is there any idea for this?
Detail script as below, and I marked the error line in red color.
public with sharing class Email_Reminding {
User USR = [Select id from User limit 1];
EmailTemplate et = [Select id from EmailTemplate where name= 'EmailTemplatename'];
Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
mail.setTargetObjectId(USR.Id);
mail.setSenderDisplayName('Jason Fang');
mail.setTemplateId(et.id);
Messaging.sendEmail(new Messaging.SingleEmailMessage[] { mail });
}
Thanks a lot.
Method calls need to be placed in methods. Try something like this:
All Answers
Method calls need to be placed in methods. Try something like this:
Thanks a lot.