You need to sign in to do that
Don't have an account?
Nerijus
How to add confirmation message?
Hi all,
I have a visualforce page which is being innitiated from the button on the record page.
I have a visualforce page which is being innitiated from the button on the record page.
<apex:page standardController="Contact" extensions="MyApexClass" action="{!create}"> <apex:form > <apex:inputHidden value="{!contact.id}"/> </apex:form> </apex:page>I have an apex class which looks like this:
public class MyApexClass { String contactId; public MyApexClass(ApexPages.StandardController controller) { this.contactId = controller.getId(); } public PageReference create() { DO STUFF..... Pagereference pg = new Pagereference('/' + contact.Id); pg.setRedirect(true); return pg; }When I'm being returned to contact page I want to show the message to the user like this one:
You can use the addMessage() method provided by the ApexPages class in your create() to display a toast message after the page is redirected back to the Contact page
Try below Related: https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/apex_pages_message.htm
https://www.eternussolutions.com/2019/04/03/now-toast-your-messages-from-visualforce-pages-too/
If this information helps, please mark the answer as best. Thank you