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
birdofpreybirdofprey 

100% coverage but still failure in deploying

I have a trigger I just created, I didn't create a test class for it because it passed with 100% coverage, and all the test classes were written by someone else

 

When It comes to deploying it, I get failures from classes that is not touch by the trigger.

 

Here is the log:

   File Name:    triggers/TotalRecruitingGoal.trigger
   Full Name:  TotalRecruitingGoal
   Action:  UPDATED
   Result:  SUCCESS
   Problem: n/a
# Test Results:
Run Failures:
  MyProfilePageController.testSave System.DmlException: Insert failed. First exception on row 0; first error: FIELD_CUSTOM_VALIDATION_EXCEPTION, Please enter a first name: [FirstName]
  TestManagement5.DeleteTeam System.DmlException: Delete failed. First exception on row 0 with id a0240000007jGFKAA2; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, TotalRecruitingGoal: execution of BeforeDelete
caused by: System.NullPointerException: Attempt to de-reference a null object
Trigger.TotalRecruitingGoal: line 30, column 17: []

 

Any ideas?

Best Answer chosen by Admin (Salesforce Developers) 
Cory CowgillCory Cowgill

Take a look at the Validation Rules in Production and Sandbox. It looks like someone has added a Validation Rule in Production which is not active in your Sandbox.

All Answers

Cory CowgillCory Cowgill

Take a look at the Validation Rules in Production and Sandbox. It looks like someone has added a Validation Rule in Production which is not active in your Sandbox.

This was selected as the best answer
Navatar_DbSupNavatar_DbSup

Hi,


Cory Cowgill is right . Apart from this please check inside the test method that is there any hardcoded value may be passed which may cause the problem.

 

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