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
Dibyadarsini SwatismitaDibyadarsini Swatismita 

Getting the following error for test class, need help to debug.

System.DmlException: Insert failed. First exception on row 0; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, APTS_OpportunityTrigger: execution of AfterInsert

caused by: System.DmlException: Update failed. First exception on row 0 with id 006S0000009qj2DIAQ; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, OpportunityAfterEventListener: execution of AfterUpdate

caused by: System.NullPointerException: Attempt to de-reference a null object

Trigger.OpportunityAfterEventListener: line 178, column 1: []

Class.OpportunityTriggerHelper.updatePriceBook: line 23, column 1
Class.OpportunityTriggerHandler.OnAfterInsert: line 7, column 1
Trigger.OpportunityTrigger: line 5, column 1:
karthikeyan perumalkarthikeyan perumal
Hello, 

Check the null exception in this trigger  "Trigger.OpportunityAfterEventListener "  

Check the condition befor this line  line 178, column 1: [] like below. 

For Example : 

if ( your Result != null)
{

 do you assignment and calculations....

}

if you are facing any issue. 

try to share your code  of this trigger "Trigger.OpportunityAfterEventListener" and test class code as well. 


will check. 

hope this will help you. 

Thanks
karthik