You need to sign in to do that
Don't have an account?
Derrick Calderon
Apex Deployment Error
The code works fine in Dev Environment, but it wont deploy to production.
Here is the error:
LeadConvert; null, Details: Test coverage of selected Apex Trigger is 0%, at least 1% test coverage is required; Average test coverage across all Apex Classes and Triggers is 0%, at least 75% test coverage is required.
Here is the code:
Can you assist?
Thank you
Derrick
Here is the error:
LeadConvert; null, Details: Test coverage of selected Apex Trigger is 0%, at least 1% test coverage is required; Average test coverage across all Apex Classes and Triggers is 0%, at least 75% test coverage is required.
Here is the code:
trigger LeadConvert on Lead (after insert,after update) { //Bulkified List<String> LeadNames = new List<String>{}; for(Lead myLead: Trigger.new){ if((myLead.isconverted==false) && (myLead.Ready_to_Convert__c == True)){ Database.LeadConvert lc = new database.LeadConvert(); lc.setLeadId(myLead.Id); lc.convertedStatus = 'Qualified'; //Database.ConvertLead(lc,true); lc.setDoNotCreateOpportunity(false); Database.LeadConvertResult lcr = Database.convertLead(lc); System.assert(lcr.isSuccess()); } } }
Can you assist?
Thank you
Derrick
have you created test method for this trigger?
From what you posted, it looks like you don't, but you need it for deployment.
Something like (it's just a sample:)):