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
Melissa Mueller 9Melissa Mueller 9 

Trigger name exists on different SObject type: Quote

Trigger name exists on different SObject type: Quote
I had a trigger that I initially wanted to work just before a Quote is saved, but we decided to move the trigger to the Opportunity object instead of the quote. I had originally set it up like this:
trigger PSGProjectDeleteTrigger on Quote (before update) {
    for(Quote quoteSelected : Trigger.new){ CODE TO COMPLETE WHEN TRIGGER FIRES }
I was able to save the trigger like that, but when I went back to it and changed it to :
trigger PSGProjectDeleteTrigger on Opportunity (before update) {
    for(Opportunity projectSelected : Trigger.new){ CODE TO COMPLETE WHEN TRIGGER FIRES }
I receive the following error:
Error: Compile Error: Trigger name exists on different SObject type: Quote at line 1 column 1

I found a post about this that suggested not using the developer console and instead going to setup>develop>apex triggers and editing it their directly. I did that and still receive the same error.

Another post suggested that I chang the name of the trigger so I added the number two to the end of the trigger name and still receive the same error.

Both Quote and Opportunity are standard objects so I am sure there is no problem with the object names.

Any ideas?????



 
Best Answer chosen by Melissa Mueller 9
LBKLBK
Hi Melissa,

Can you copy (backup) the trigger code to a text file and delete the original trigger first?

And, the recreate the trigger again on Opportunity object?

Don't forget to change the object name in the code you have copied.

All Answers

LBKLBK
Hi Melissa,

Can you copy (backup) the trigger code to a text file and delete the original trigger first?

And, the recreate the trigger again on Opportunity object?

Don't forget to change the object name in the code you have copied.
This was selected as the best answer
Melissa Mueller 9Melissa Mueller 9
Thanks LBK! That absolutely worked! I guess the only explanation for that is that when you create a new trigger, what looks like it's just pre-populating a header for you is really tying that to the specific object somewhere within the system. Definitely a good thing to be aware of in the future!!! Such a simple fix!
Has NahHas Nah
I had a simmilar issue and I closed then reopened my Dev Console and it worked
Brandon Isaac FonsecaBrandon Isaac Fonseca
Closing and reopened my developer console work for me too. :)