• balagani1.3914993504421423E12
  • NEWBIE
  • 0 Points
  • Member since 2014

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

Sometimes I have trigger errors pop up with a validation rule error embedded inside. The reason is because the trigger got an error because the validation rule raised an error. How do I make only the validation rule error pop up?

  • May 03, 2012
  • Like
  • 0

Hi,

When i handle the validation from trigger using trigger.new.adderror('Message...') for delete functionality the error is being displayed but not in the same page it is being displayed in the system page(new page) as a runtime exception.

 

The error displayed is:

There were custom validation error(s) encountered while saving the affected record(s). The first validation error encountered was "MSG_CANNOT_DELETE_RECORD_WITH_ASSOCIATION : Record cannot be deleted because it is associated with another record.". 



 

 

Have even used return; keyword after adding the adderror functionality inorder to avoid the other operations to be handled but even then this message is being raised.

Please let me know if anyone has a soln inorder to avoid the issue.

 

Thanks