You need to sign in to do that
Don't have an account?
The Trigger 'AccountTrigger' does not appear to be calling the AccountTriggerHandler class correctly or using isBefore or isInsert content variables.
I'm working through Apex & .NET Basics - Understanding Execution Context
When validating the challenge I'm getting the error:
Why would I need to check Trigger.isBefore and Trigger.isInsert if the trigger is only on before insert?
When validating the challenge I'm getting the error:
Challenge Not yet complete... here's what's wrong:
The Trigger 'AccountTrigger' does not appear to be calling the AccountTriggerHandler class correctly or using isBefore or isInsert content variables.
The trigger I currently have is minimal:
trigger AccountTrigger on Account (before insert) { AccountTriggerHandler.CreateAccounts(Trigger.new); }
Why would I need to check Trigger.isBefore and Trigger.isInsert if the trigger is only on before insert?
This is the trigger framework so multiple even we can use in same trigger that is why we need to use context varaible.
Well you can submit your feedback on same.
All Answers
if (Trigger.isBefore && Trigger.isInsert)
AccountTriggerHandler.CreateAccounts(Trigger.New);
This is the trigger framework so multiple even we can use in same trigger that is why we need to use context varaible.
Well you can submit your feedback on same.
Please check below post for solution.
1) https://developer.salesforce.com/forums/?id=906F0000000DBRhIAO
2) https://developer.salesforce.com/forums/ForumsMain?id=906F0000000DCwCIAW
Please update your AccountTrigger and add "Trigger.isBefore". AccountTrigger - Trigger On Account Object
Let us know if this will help you