- April 30, 2016 at 10:02 am #10838Ravi #180
How to display a message when the trigger finishes?
Is it possible to display any message from a trigger directly?. I have created a trigger that doing some operation. I need that once the trigger finishes, without error, it display some success message to the userApril 30, 2016 at 10:25 am #10852Abhinav #188
You can’t display an alert from a trigger. Trigger doesn’t have any direct access to the user interface.June 9, 2017 at 2:40 pm #20412Sudhir #381
Firstly, please try to provide a use case of your scenario.
Now coming to your question, if the motive is to display a message on record detail page or layout, there is a way.
Create a Vf page with outputPanel having rendered attribute. ReRender this panel id when your controller gets the boolean flag passed from trigger or you can make a query if you are using a boolean field in trigger. Embed this VF age on the layout.
Initialize a boolean variable(you can use boolean field also) as false in the trigger. When your trigger finishes, paas a boolean variable as true into the vf page controller. Refer that boolean variable into vf page rendered attribute.
There could be other similar ways. You could give it a try.February 14, 2020 at 2:35 pm #69516
Please Register to reply to this topic. /