You need to sign in to do that
Don't have an account?

Trigger should display "note" once, rather than an error message
Hi,
I have to get this implemented and just don't know how:
When a user edits a record (opportunity to be exact) and hits "Save", a "before update" trigger should display a note message (via addError) - however if the user hits "Save" again, the record should be saved. So I have to get rid of addError in the 2nd run of the trigger...
Any input appriciated!
Cheers,
Harry
Try not to get caught up in the "extras", just pay attention to the saveRecord method; in here, I check to see if I've already produced a warning, and if not, I do so, otherwise I save. This is a trivial example, but I hope it helps you out.
All Answers
You can't do this. Use Visualforce instead. I've already barked up this tree, and I realized that each transaction is a separate transaction, so it can't determine if the addError message has already been shown. I've even tried things like modifying a field value and using addError, and the result is that the changes are lost.
Thanks for the hint. How exactly would you solve this using VF?
Regards,
Harald
Try not to get caught up in the "extras", just pay attention to the saveRecord method; in here, I check to see if I've already produced a warning, and if not, I do so, otherwise I save. This is a trivial example, but I hope it helps you out.
Ah, ok. I was hoping there is a solution that does not require to rebuild the entire "edit form" of the concerned object.
Thanks anyway, thats helping a lot.
Regards,
Harry