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
Neha KakrooNeha Kakroo 

Display Alert box through the trigger - salesforce

Can somebody tell me how can we display an alert message (not error message) through the trigger. I have written a trigger that checks for duplicate accounts in the system. At present my trigger gives the error message to the user telling that there is a duplicate account. But if the user changes the value of a field "Is record near to duplicate" to YES, the trigger allows the user to save the record.

But, I want to display the error message in an alert pop up box like "Account with this Name exists,are you sure you want to continue" and then user clicks Yes and the record gets created. Any thoughts on how I can do this.

 

 
 

sanjdevsanjdev

Hi,

 

You can't display an alert from a trigger -- a trigger doesn't have any direct access to the user interface.

 

Please follow the link for possible solution: http://stackoverflow.com/questions/11595574/display-alert-box-through-the-trigger-salesforce

 

Mark it as resolved if it helps you.

Sanj