• #10838
    Salesforce | Ravi Ravi #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 user


    Salesforce | Abhinav Abhinav #188

    Hello Ravi,

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

    Salesforce | Sudhir Sudhir #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.

    Salesforce | Pooja Pooja #8

    No, it is not possible to display any message from a trigger directly.

Viewing 4 posts - 1 through 4 (of 4 total)

Please to reply to this topic.


We're not around right now. But you can send us an email and we'll get back to you, asap.


About Us

Forcetalks is a Salesforce collaboration platform for coders & developers, geeks & nerds, consultants & business heads, admins & architects, managers & marketers and of course the business owners. A community where you can learn from, where you can contribute to. For you. For Salesforce. Read More...

Copyright 2020 Forcetalks. All Right Reserved.

Log in with your credentials


Forgot your details?