13

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)
  • Yeah, if the IDE is creating triggers/classes with no namespace, that does seem like a bug, especially if it creates the namespaced version also. Does it do the same thing for each Apex Class? Is it reproducible? – Adrian Larson Sep 9 '16 at 15:24
  • @AdrianLarson I'm not even sure how it appeared. What I do know is that the created date for both triggers are one minute apart, August 7th, 2015. I've never seen it before, and I tried all the usual methods of creating triggers, but I can't reproduce it. The only odd thing is that this appears to be a trigger generated by the system, and not by me. I would never have used underscores in a trigger name directly, nor have a name that was as verbose as that. Google shows a lot of Chatter (no pun intended?) about this trigger, but I don't know how/why it appeared in my system. – sfdcfox Sep 9 '16 at 15:35
  • But how did you find it except by creating a trigger with the same name. Who's the CreatedBy? – Adrian Larson Sep 9 '16 at 15:36
  • @AdrianLarson Both files are created by my user account, which isn't much of a surprise given I'm the only user there. The files were created at 2015-08-07T19:57:52.000+0000 and 2015-08-07T19:58:42.000+0000 respectively, 50 seconds apart, at what would have been about 2:57 and 2:58 PM on a Friday afternoon. – sfdcfox Sep 9 '16 at 15:44
  • @AdrianLarson I added the results from a query that shows the files. The non-namespaced file appears earlier. My namespace existed long before 2015, although I'd have trouble tracking it down, as I don't know how to find that information. The org itself is from January 2007, and the namespace most likely would have been created in 2008 or so. – sfdcfox Sep 9 '16 at 15:48
1

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.

  • Thanks! I'm going to take this up with salesforce.com now that I know what's going on. It totally makes sense, and I can imagine how this could screw up an ISV's packaging org (luckily, this is my own personal dev org, so no harm there). – sfdcfox Apr 29 '17 at 21:16
  • Thanks for posting this interesting observation! It makes one wary to enable "features". As for Salesforce, they are sure to point out "Chatter Answers" is not available on new orgs anymore. – Felix van Hove Apr 29 '17 at 21:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.