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
Sonia GenesseSonia Genesse 

Trigger Code Coverage Failure

Good Afternoon!

I performed a Change Set deployment from Sandbox to PROD, and I'm receiving a Code Coverage Failure for one of my Triggers.
I have two other Triggers in Sandbox that also have 0% Test Coverage, and these two are not failing the deployment. 

Component Errors
 
API Name
Type
Line   Column   Error Message
0              0      PopulateProduct, Details: Test coverage of selected Apex Trigger is 0%, at least 1% test coverage is required.

Could this be a coding issue, since I'm also receiving another failure as follows:

Component Errors

API Name
Type
Line  Column   Error Message
0        0           SVMX_SFM_Extensions_UT.testclass(), Details: System.NullPointerException: Attempt to de-reference a null object                                        Class.SVMX_SFM_Extentions.SVMX_GenSrvRpt: line 79, column 1 Class.SVMX_SFM_Extentions.SVMX_GenSrvRpt_WS:                             line 47, column 1 Class.SVMX_SFM_Extensions_UT.testclass: line 88, column 1


Apex Test Failures

Class Name                            Method Name    Error Message
SVMX_SFM_Extensions_UT    testclass           SVMX_SFM_Extensions_UT testclass System.NullPointerException: Attempt to de-reference a                                                                        null object Stack Trace: Class.SVMX_SFM_Extentions.SVMX_GenSrvRpt: line 79, column 1                                                                          Class.SVMX_SFM_Extentions.SVMX_GenSrvRpt_WS: line 47, column 1                                                                                                        Class.SVMX_SFM_Extensions_UT.testclass: line 88, column 1


Assistance is much appreciated!

Thanks,
Sonia
 


 
Best Answer chosen by Sonia Genesse
AshlekhAshlekh
Hi,

You need to write a test class for your Trigger to increase the coverage atleast 1% and need to fix the test failure.

-Thanks
Ashlekh Gera

All Answers

AshlekhAshlekh
Hi,

You need to write a test class for your Trigger to increase the coverage atleast 1% and need to fix the test failure.

-Thanks
Ashlekh Gera
This was selected as the best answer
Sonia GenesseSonia Genesse
Thank you Ashlekh. 

Working on resolveing the failure. Since I've never written a test class before I'll look online for documention.


Thanks,
Sonia