+ Start a Discussion

Case Apex trigger deployment being affected by recent install of Chatter apps

Today I was trying to deploy a small Apex Trigger from my sandbox to production. Here is the code:



trigger commentMove on Case (after update) {
  Case myCase = trigger.new[0];
  if (myCase.Last_email__c!= null) {
    String caseId= myCase.ID;
    CaseComment cc = new CaseComment(CommentBody=myCase.Last_email__c,parentID=caseId);
    insert cc;




However I got a failed deployment and when I looked at it what failed was:


chatterFollowLists.testFollowAllRule()Class1816Failure Message: "System.Exception: Assertion Failed: Expected: 0, Actual: 1", Failure Stack Trace: "Class.chatterFollowLists.testFollowAllRule: line 181, column 6 External entry point"

Failure Message: "System.Exception: Too many query rows: 501", Failure Stack Trace: "Class.chatterFollowRules.testFollowEveryone: line 650, column 55 External entry point"


I installed the Chatter Follow From List View yesterday. Why would this be failing my Case Apex trigger?


Are you using ecllipse for development? If yes please do check the schema there if there is some co-relation or some common object which be getting effected.

Have you written to support@salesforce.com, may be they might have come across such issues previously too and would be able to give you a speedy solution.



Just logged a case with support. I will see what they say thanks. by the way I was using Deployments between Sandbox and Production instead of the IDE.


I also ran into this issue because of the 'chatter' classes being unpackaged. I'm surprised more people aren't running into this issue and I don't understand why Salesforce is installing chatter as an unpackaged app.