Developer Edition with Namespace: duplicate triggers?

In my namespaced Developer Edition org, I started using Cloud 9 IDE, which, despite being a beta, is pretty amazing. However, in one of my orgs, Cloud 9 refused to work without any explanation. I plan on filing a bug with them, but I traced the problem to something I thought was impossible: I had two triggers by the same name, with different content, one with the namespace and one without. Of course, since the API was stripping the namespace from my files (because it’s the managed package org), the file system got confused and couldn’t save the files.

The trigger in question is: chatter_answers_question_escalation_to_case_trigger, which I presume was made by the system, because I certainly don’t call making it, nor would I use such an unusual naming convention. However, it’s now in my system twice, and I’m confused how a non-namespaced file could have made its way into my org, since this thing has had a namespace that predates any of the current code in the org. No other classes, pages, triggers, etc exhibit this behavior, and I cannot make another non-namespaced code object manually through any technique I know.

Is there a known bug around this? Under what circumstances could this have occurred? I presume it’s safe to delete one, but I was really curious what led to this phenomenon to begin with. I’ll accept any answer which either shows documentation of the bug, or a way to reproduce this bug so I can file a report with salesforce.

Edit:

The system allows me to edit both triggers independently. In fact, I just renamed both of them to a new conflicting name, and they both saved. The non-namespaced trigger still has no namespace after the edit.

Edit 2:

The files appear as follows:

 CreatedBy.Name | NamespacePrefix | Name                                                | CreatedDate                  
----------------+-----------------+-----------------------------------------------------+------------------------------
 Brian Fear     | (null)          | chatter_answers_question_escalation_to_case_trigger | 2015-08-07T19:57:52.000+0000 
 Brian Fear     | <<redacted>>    | chatter_answers_question_escalation_to_case_trigger | 2015-08-07T19:58:42.000+0000 
 (2 records)

Answer

Steps to reproduce: Enable “Chatter Answers”. This generates the trigger chatter_answers_question_escalation_to_case_trigger without namespace. Download the trigger via the Metadata API to your local box. Then upload it via Metadata API, e.g. via the migration tool with sf:deploy – outch! Two triggers with the same name, just distinguished by an empty or non-empty namespace prefix.

Attribution
Source : Link , Question Author : sfdcfox , Answer Author : Felix van Hove

Leave a Comment