• Raspikabek
  • NEWBIE
  • 0 Points
  • Member since 2017
  • Development Manager
  • 3nitram

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies

Hi Folks,

               How to update original object fields with update DML statement in trigger after insert event. My code:

 

trigger myTrigger on Account (after insert) {

Account myAccount = trigger.new[0];
myAccount.Type = 'Enterprise Customer';
update myAccount;
}

 

Here the update DML statement throws the exception: System.FinalException: Record is read-only:

 

Please let me know and all suggestions are appreciated with any sample code or correction to above code.

 

Thanks.