CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY

A trigger or flow threw an unhandled exception during the save. This code is a wrapper. The real cause follows in the message.

CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, AccountTrigger: execution of AfterInsert
caused by: System.NullPointerException: Attempt to de-reference a null object
Class.AccountHandler.setRegion: line 42, column 1

Common causes

  • An Apex exception inside a trigger or its handler class.
  • A managed package trigger failing on your data.
  • A record-triggered flow failing on an element.

How to fix

  • Read the text after caused by and look up that exception in this guide.
  • Go to the class and line number named in the message.
  • Reproduce the save with a debug log running to see the values involved.
  • For managed package triggers, check the package configuration and contact the vendor.

You may also like...