• shreya duggal
  • NEWBIE
  • 0 Points
  • Member since 2019

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 1
    Replies
I have a trigger which is added to object A in which I need to show error on save button but at the same time I need to insert record in a custom object B. I am using trigger.new[0].addError('Message') and then using database.insert to insert the data in the custom object B but the record is not getting created as I read in documentation that addError rollbacks the DML operation but I need both the error and DML operation to function.  Can anyone help me with this?