You need to sign in to do that
Don't have an account?
John Rankin 1
Trailhead Trigger Issue
Hi everyone,
I am currently going through all of the TrailHead Modules in my spare time. I am currently on the Apex Trigger module and I am having an issue. When I go to save the initial example trigger it just keeps saying saving and never actually saves. I've copied my code below.
trigger helloWorldTrigger on Account (before insert) {
System.debug('Hello World!');
}
The one thing I noticed that was different was that in the example Hello World! is green while in my code it is red.
I am currently going through all of the TrailHead Modules in my spare time. I am currently on the Apex Trigger module and I am having an issue. When I go to save the initial example trigger it just keeps saying saving and never actually saves. I've copied my code below.
trigger helloWorldTrigger on Account (before insert) {
System.debug('Hello World!');
}
The one thing I noticed that was different was that in the example Hello World! is green while in my code it is red.
Can you please do the following:
trigger helloWorldTrigger on Account (before insert) {
if(Trigger.isBefore && Trigger.isInsert)
System.debug('Hello World!');
}
I don't have any issues saving your trigger in my developer org. Any chance you are using the developer console? It behaves oddly sometimes. Do you get any errors if you try to access and develop your trigger from Setup | Develop | Apex Triggers?
Can you please copy this code and paste it directly in the org(don't use any IDE)?
That seems to have worked but now when I created a test account following trailhead there is nothing in the Debug log that says Hello World.
If not I would double-check that the trigger is active: