function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
John Rankin 1John 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.  
Pankaj_GanwaniPankaj_Ganwani
Hi John,

Can you please do the following:

trigger helloWorldTrigger on Account (before insert) {
    if(Trigger.isBefore && Trigger.isInsert)
          System.debug('Hello World!');
}
John Rankin 1John Rankin 1
I tried your code and it's the same issue.  Could it be a permissions issue?  I'm using a developer instance so I am set as the system admin.
VinojVinoj
Hey John,

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?
Pankaj_GanwaniPankaj_Ganwani
Hi,

Can you please copy this code and paste it directly in the org(don't use any IDE)?
John Rankin 1John Rankin 1
Hi Vinoj,

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.
VinojVinoj
That's strange.  Not sure why that would be.  Do you see any reference to your trigger in the log:

User-added image

If not I would double-check that the trigger is active:
User-added image