0

I am trying to deploy a destructive package, but I am receiving the following errors in test classes:

  • System.DmlException: Insert failed. First exception on row 0; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, OpportunityLineItemTriggers: execution of BeforeInsert caused by: System.NullPointerException: Attempt to de-reference a null object

  • System.DmlException: Update failed. First exception on row 0 with id 0067h00000BGr8vAAD; first error: INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY, 0067h00000BGr8v: []

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

  • System.QueryException: List has no rows for assignment to SObject

P.s: these errors appeared in several test classes that were inserting and updating accounts, opportunities and users.

1

I found that the Sharing Calculation was disable.

So, using an Admin user:

  • Enter in setup,
  • in quick search, type "Defer Sharing Calculation" and select it.
  • Then active it.
  • Try to deploy your package again.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.