• Derrick Billie
  • NEWBIE
  • 35 Points
  • Member since 2016

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 3
    Replies
Hi!

I have a trigger that I got off a comment in the Success Community (thanks Subramani!) that adds Case Comments to Cases during the same import (rather than first importing Cases and then Case Comments based on the parent ID). The trigger is in the Sandbox and I am unable to deploy it because there is not enough code covereage. I am told that I need to have a test class for this trigger in order to be able to test and deploy it to Production. I am pretty new to SF administration and have almost no experience writing in Apex. Would anyone be able to help me create a test class for the following trigger?

trigger CreateCaseComment on Case (after insert) {

List<CaseComment > casecmlist=new list<CaseComment >();

for(Case c : Trigger.new){
     if(c.commentCL__c!= ''){

        CaseComment cc = new CaseComment();
        cc.commentBody = c.commentCL__c;
        cc.ParentId = c.Id;
        casecmlist.add(cc);
     }
 }
 if(casecmlist!=null){
 insert casecmlist;
 }
}

I really appreciate any assistance I can get! Thank you!
Hi!

I have a trigger that I got off a comment in the Success Community (thanks Subramani!) that adds Case Comments to Cases during the same import (rather than first importing Cases and then Case Comments based on the parent ID). The trigger is in the Sandbox and I am unable to deploy it because there is not enough code covereage. I am told that I need to have a test class for this trigger in order to be able to test and deploy it to Production. I am pretty new to SF administration and have almost no experience writing in Apex. Would anyone be able to help me create a test class for the following trigger?

trigger CreateCaseComment on Case (after insert) {

List<CaseComment > casecmlist=new list<CaseComment >();

for(Case c : Trigger.new){
     if(c.commentCL__c!= ''){

        CaseComment cc = new CaseComment();
        cc.commentBody = c.commentCL__c;
        cc.ParentId = c.Id;
        casecmlist.add(cc);
     }
 }
 if(casecmlist!=null){
 insert casecmlist;
 }
}

I really appreciate any assistance I can get! Thank you!
I need some expert opinion on this.
We have two full sandboxes where one of them(FFDEV) has been given our finanacialforce consultants who worked on some huge project. That financialforce project was on hold for quite some time and because of this the FFDEV has not been refreshed for last 10 months. At the same time, we have done many CRM changes via the other full sandbox to production. Now that we want to restart the financialforce project, we do not want to loose any of the development done by the financialforce consultant in FFDEV, how can I get the latest prodution refreshed to FFDEV? A normal refresh will erase all the developments done in the first phase of project. Do you have any suggestions/advices? The Financialforce changes in FFDEV inlude huge custom ERP apps and many (MANY) customizations on top that. 
Your support will be much appreciated!
​Thanks