• #10838
    Salesforce | Ravi Ravi #180
    Forcetalks

    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

     

    #10852
    Salesforce | Abhinav Abhinav #188
    Forcetalks

    Hello Ravi,

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

    #20412
    Salesforce | Sudhir Sudhir #381
    Forcetalks

    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.

    #69516
    Salesforce | Pooja Pooja #8
    Forcetalks

    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.

CONTACT US

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

Sending

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

or    

Forgot your details?