function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Matthias KimmigMatthias Kimmig 

How can I display error messages on a popup?


I hava create a button in a custom object which execute a apex-class.
This apex-class create a contact and a opportunity with the information from the custom object.

It works fine. Now, I would like to throw exceptions and display the error messages on a popup.

How can I do this?

Rajesh PotnuruRajesh Potnuru
Hello Matthias,

To show error message popups , better to go with Java script.. check the below example.,

function deleteConfirm(msg)
var confDel = msg;
if(confDel ==null)
  confDel= confirm("Would you like to perform this delete action?");
  confDel= confirm(msg);
if (confDel== true)

Thanks & Regards,
Rajesh Potnuru

* Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved.