+ Start a Discussion
Swapnil PatneSwapnil Patne 

Trigger deactivation error.

Hi All,

 

I am trying to deactivate a trigger in production org deploying it through sanbox, but it fails to deactivate the trigger.

Below is the error code, could you please help me understand what the belwo error means and how to tackle the error code and resolve the issue?

 

DeleteRWClient.DelRecs() 

Type: Class Line:79 Column:1

Failure Message: "System.ListException: List index out of bounds: 0", Failure Stack Trace: "Class.DeleteRWClient.DelRecs: line 79, column 1"

 

ManageAppointments.CheckAll()

Type: Class  Line:71 Column: 5 

Failure Message: "System.DmlException: Update failed. First exception on row 0 with id 0062000000Knx2YAAR; first error: FIELD_CUSTOM_VALIDATION_EXCEPTION, You must add products to this opportunity before saving.: []", Failure Stack Trace: "Class.ManageAppointments.AddNew: line 715, column 1 Class.ManageAppointments.CheckAll: lin...

 

TriggerCodeCoverage.UPDATE_TOTALAPPS_FIXED_REMAINING()

Type: Class  Line:70 Column:1 

Failure Message: "System.DmlException: Update failed. First exception on row 0 with id 0062000000Knx2YAAR; first error: FIELD_CUSTOM_VALIDATION_EXCEPTION, You must add products to this opportunity before saving.: []", Failure Stack Trace: "Class.TriggerCodeCoverage.UPDATE_TOTALAPPS_FIXED_REMAINING: line 70, column 1"                       

 

Deploy ErrorAverage test coverage across all Apex Classes and Triggers is 67%, at least 75% test coverage is required.

 

Reagards

Swapnil

Sys Admin,

 

b-Forceb-Force

Here you are deploying code to production from sandbox,

and By default it runs all related test methods for code coverage. You need to resolve all specified errors in Log.

 

DeleteRWClient.DelRecs() 

Type: Class Line:79 Column:1

Failure Message: "System.ListException: List index out of bounds: 0", Failure Stack Trace: "Class.DeleteRWClient.DelRecs: line 79, column 1"

 

To resolve above error, make sure your list contains some records.

Example :

 

List<Lead> lstLead =[Select Id from Lead];

 

if you are accessing 5th record like  lstLead[4] , you can check index first to avoid exception

 

if(lstLead.size() >= 5 )

{

// then access lstLead[4]

}

 

 

ManageAppointments.CheckAll()

Type: Class  Line:71 Column: 5 

Failure Message: "System.DmlException: Update failed. First exception on row 0 with id 0062000000Knx2YAAR; first error: FIELD_CUSTOM_VALIDATION_EXCEPTION, You must add products to this opportunity before saving.: []", Failure Stack Trace: "Class.ManageAppointments.AddNew: line 715, column 1 Class.ManageAppointments.CheckAll: lin...

 

 

Here is some custom validation , create proper test data

 

 

TriggerCodeCoverage.UPDATE_TOTALAPPS_FIXED_REMAINING()

Type: Class  Line:70 Column:1 

Failure Message: "System.DmlException: Update failed. First exception on row 0 with id 0062000000Knx2YAAR; first error: FIELD_CUSTOM_VALIDATION_EXCEPTION, You must add products to this opportunity before saving.: []", Failure Stack Trace: "Class.TriggerCodeCoverage.UPDATE_TOTALAPPS_FIXED_

REMAINING: line 70, column 1"       

 

*** Here is also some custom validation, make sure you are preparing correct test data which will pass above validation rules

 

 

 

Hope this will help you.

 

 

Thanks,

Bala

 

 

 

Starz26Starz26

Do what previous poster said first.

 

To deactive the trigger eaisly

 

Open eclipse

Create a new project

Add all trigger from production

Open the meta file for the trigger

change the status to inactive

save to server,

 

boom, inactivated.