5

I want to display an error message using apex trigger and display a list with bullets beside it, like

  • record name 1
  • record name 2

in the error message.

Is this possible with a trigger?

addError() is showing error only for one record, I want to display list of all.

  • Adding your existing code to your question will allow others to help more – Girbot Jan 28 '16 at 20:05
7

You could call addError()on each record, but that would give you multiple messages instead of the bullet list you want. There is an overloaded form of the addError method that can display your error with un-escaped markup though that might get you what you want. Basically, you could build up an html formatted string with all the content you want to display, then call addError(errString, false)

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.