0

Afer finishing writing code, the error msg displayed as:

"There was an unexpected error in your org which is preventing this assessment check from completing: System.DmlException: Insert failed. First exception on row 0; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, AccountTrigger: execution of BeforeInsert caused by: System.SObjectException: DML statement cannot operate on trigger.new or trigger.old Class.AccountTriggerHandler.CreateAccounts: line 11, column 1 Trigger.AccountTrigger: line 3, column 1: []";

My code link is https://na112.salesforce.com/_ui/common/apex/debug/ApexCSIPage

What is it?

  • 2
    Looks like you're trying to insert/update/delete on Trigger.new or Trigger.old which you can't do, as the error says. Can't see your code either, as that would mean logging in to your Salesforce org. – Phil Hawthorn Sep 21 '19 at 7:21
  • trigger AccountTrigger on Account (before insert) { if(Trigger.isBefore && Trigger.isInsert){ AccountTriggerHandler.CreateAccounts(Trigger.New); } } – Ryan Ren Sep 21 '19 at 7:35
  • Answered it in your question – salesforce-sas Sep 21 '19 at 7:37

Your Answer

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

Browse other questions tagged or ask your own question.