You need to sign in to do that
Don't have an account?
Nalinaku
Opportunity line item test class trigger error
Hi,
I am running a test class on opportunity, which is inserting opportunity line items in couple of methods and everytime its trying to insert the Opp line item I get the below error from the trigger.
It looks like Opp line item is getting inserted but trigger is failing them.
The line number which shows in the error is again the update/insert of opp line item which is failing.
I checked the error Attempt to dereference null object, but I see new object is instatiated whereever dml is being performed.
I checked the UserAssignHelper.checkLineItems at line 13 which is getting values from custom settings and I see values exists there.
Please suggest.
I am running a test class on opportunity, which is inserting opportunity line items in couple of methods and everytime its trying to insert the Opp line item I get the below error from the trigger.
It looks like Opp line item is getting inserted but trigger is failing them.
The line number which shows in the error is again the update/insert of opp line item which is failing.
I checked the error Attempt to dereference null object, but I see new object is instatiated whereever dml is being performed.
I checked the UserAssignHelper.checkLineItems at line 13 which is getting values from custom settings and I see values exists there.
Please suggest.
System.DmlException: Insert failed. First exception on row 0; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, PSLR_OpportunityLineItem: execution of AfterInsert caused by: System.DmlException: Update failed. First exception on row 0 with id 00k2i000003lJCDAA2; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, PSLR_OpportunityLineItem: execution of AfterUpdate caused by: System.NullPointerException: Attempt to de-reference a null object Class.UserAssignHelper.checkLineItems: line 13, column 1 Class.PSLR_OpportunityLineItemHandler.updateOppOwnerBasedOnLineItemPricingType: line 122, column 1 Trigger.PSLR_OpportunityLineItem: line 50, column 1: [] Class.PSLR_OpportunityLineItemHandler.NoOfLineItem: line 28, column 1 Trigger.PSLR_OpportunityLineItem: line 42, column 1: []
Please try doing that and you should get no error.
if it helps please mark as correct as it may help others.
if not please provide the entire code to help you more
All Answers
Please try doing that and you should get no error.
if it helps please mark as correct as it may help others.
if not please provide the entire code to help you more