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
Steven HoughtalenSteven Houghtalen 

I am getting a weird compile error trying to save an apex trigger class

Here is the error message: Error: Compile Error: Cannot save a trigger during a parse and save class call at line -1 column -1

I stripped everything out of the class and still get it.  Hope someone can help.

trigger TrafficShadow on Traffic__c ( after update, after insert) {
}
 
Best Answer chosen by Steven Houghtalen
Steven HoughtalenSteven Houghtalen
I finally figured it out.   I was trying to create the trigger using setup>develop>apex class>new.   To develop a trigger (in sandbox) you go to the object that will cause the trigger, scroll down to "Trigger" and select "new".   Horrible error message. 

All Answers

AnkaiahAnkaiah (Salesforce Developers) 
Hi Steven,

try with below.
Trigger TrafficShadow on Traffic__c (After Insert,After Update){

}

If this helps, Please mark it as best answer.

Thanks!!​​​​​​​
mukesh guptamukesh gupta
Hi Steven,

I think same name trigger already exist in your org So please try with below:-
 
Trigger TrafficShadowTrigr on Traffic__c (After Insert,After Update){

}
if you need any assistanse, Please let me know!!

Kindly mark my solution as the best answer if it helps you.

Thanks
Mukesh

 
Steven HoughtalenSteven Houghtalen
I finally figured it out.   I was trying to create the trigger using setup>develop>apex class>new.   To develop a trigger (in sandbox) you go to the object that will cause the trigger, scroll down to "Trigger" and select "new".   Horrible error message. 
This was selected as the best answer