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
Jamison BrownJamison Brown 

Need Some Help Deactivating or Deleting an Apex Trigger

We have a third party APP installed called MassConvertLeads. Attached to this is an Apex trigger called Batch_ConvertLead. This trigger is probably pretty self explanatory, but the code is listed below. Our version of the app expired and we may not renew it, but it is currently scheduled to run as a lead is saved as new. Since the app is expired, it will not allow a new lead to enter our database. I tried to deactivate the trigger so I could uninstall the app, but I am getting testing errors so the deactivation of the trigger will not deploy. Any thoughts?

 

rigger Batch_ConvertLead on Lead (after insert, after update)
    {
        //if(MassLeadConvert.runLeadTrigger)
        //{
                try
                  {
                    //create a string of ids to be converted
                    String records = '';
                    
                    //get all the records with status Lead Source = Web and Lead Status = Qualified
                    for(Lead lead : Trigger.New)
                        {
                            if(lead.IsConverted == false)
                                {
                                    if(records == '')
                                        records = lead.Id;
                                    else
                                        records = records + ',' + lead.Id;
                                }
                        }
                        
                    System.debug('Records in trigger :::::' + records);
                    
                    //call the single click lead convert method to convert the lead 
                    if(records != '')
                        {
                          MassConvert.MassLeadConvert.enableAutoConvert(true);
                          MassConvert.MassLeadConvert.ConvertRecords(records,true,true,'','',false,'');
                        }
                  }
              catch(Exception e)
                {
                  new Lead().addError(e.getMessage());
                }
        //}
    }

 

 

Test Results:

 

API NameTypeLineColumnProblem

Test_Trigger_ConvertLead.myUnitTest()Class231Failure Message: "System.AssertException: Assertion Failed", Failure Stack Trace: "Class.Test_Trigger_ConvertLead.myUnitTest: line 23, column 1"
TestMethodCls3.myTest1()Class571Failure Message: "System.DmlException: Insert failed. First exception on row 0; first error: REQUIRED_FIELD_MISSING, Required fields are missing: [Unfuddle_Ticket__c, Unfuddle_Summary__c]: [Unfuddle_Ticket__c, Unfuddle_Summary__c]", Failure Stack Trace: "Class.TestMethodCls3.myTest1: line 57, column 1"
TestMethodCls3.myTest2()Class1461Failure Message: "System.DmlException: Insert failed. First exception on row 0; first error: REQUIRED_FIELD_MISSING, Required fields are missing: [Unfuddle_Ticket__c, Unfuddle_Summary__c]: [Unfuddle_Ticket__c, Unfuddle_Summary__c]", Failure Stack Trace: "Class.TestMethodCls3.myTest2: line 146, column 1"
TestMethodCls3.myTest3()Class2061Failure Message: "System.DmlException: Insert failed. First exception on row 0; first error: REQUIRED_FIELD_MISSING, Required fields are missing: [Unfuddle_Ticket__c, Unfuddle_Summary__c]: [Unfuddle_Ticket__c, Unfuddle_Summary__c]", Failure Stack Trace: "Class.TestMethodCls3.myTest3: line 206, column 1"
caseOwnerUpdate   Test coverage of selected Apex Trigger is 0%, at least 1% test coverage is required