function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

Help on trigger deployment

Hi Guys,


I am deploying  below trigger in our production but im always getting "Test coverage of selected Apex Trigger is 0%, at least 1% test coverage is required". This is my first time creating a trigger could someone help me please.


trigger twebLead on Lead (after update) {
   if ( == 1) {
     if (Trigger.old[0].isConverted == false &&[0].isConverted == true) {
      if ([0].ConvertedAccountId != null) { 
        Account a = [Select a.Id, a.CurrencyIsoCode From Account a Where a.Id =[0].ConvertedAccountId];
        a.CurrencyIsoCode = 'PHP';
        update a;
      if ([0].ConvertedOpportunityId != null) {
        Opportunity o = [Select o.Id, o.CurrencyIsoCode from Opportunity o Where o.Id =[0].ConvertedOpportunityId];
        o.CurrencyIsoCode = 'PHP';
        update o;


I don't know what i am missing since i have deployed the same code in sandbox and worked well.







You will have to create test class for this trigger then deploy both (trigger and test class) in production.


Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved. 


Thanks, can you give me a sample on how should i begin this? :( sorry