You need to sign in to do that
Don't have an account?
Brandon Nelson 9
Customer APEX Trigger Code Failure
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.
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; } }
This is breaking your code most probably.
With Regards,
Protar Smith
References: kodi.software (https://kodi.software/) | show-box.ooo (https://show-box.ooo/) | dltutuapp.com (https://dltutuapp.com/)