• Zagakuf Smith
  • NEWBIE
  • -3 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 2
    Replies
I have a trigger that I need to put in production, but I keep getting the following error. Can someone please look at my trigger and tell me why this is happening?
ERROR: The following triggers have 0% code coverage. Each trigger must have at least 1% code coverage.
Trigger ConvertToClient on Lead_Prospect__c(after insert, after update){
  //Adding the name to the Client record//
     
     List<Client__c> cons =new List<Client__c>();
     String idStore = null;
     Object tId = null;
     for(Lead_Prospect__c a :trigger.new){
     
         idStore = (String)a.id;
         List<Client__c> idChecks = [SELECT Prospect_ID__c FROM Client__c WHERE Prospect_ID__c = :idStore];
       if(a.Convert_to_Client__c == true && idChecks.size() <= 0){
          Client__c c  =new Client__c();
          c.Name = a.Name;
          c.Enagement_Type__c = a.Engagement_Type__c;
          c.Prospect_ID__c = a.id;
          tId = a.id;
           cons.add(c);
        
           }
   }
if (cons.size()>0){
    insert cons;
    Client__c c = [SELECT Prospect_ID__c FROM Client__c WHERE Prospect_ID__c = :idStore];
    Lead_Prospect__c a = [SELECT Client_Name__c FROM Lead_Prospect__c WHERE Id = :idStore];
    a.Client_Name__c = c.id;
    
    update a;
}
}



 
Hello

I am stuck on the  Improve your Classic App by Moving to Lightning Experience module
It refers to Dreamhouse Classic app
Where is it to be found ? several project relies on this but I only have DreamHouse app, not the Classic one
thanks