+ Start a Discussion
Flint LockwoodFlint Lockwood 

Custom Success Message Lightning Action

Hi,

Is it possible to use merge fields in custom success messages in Lightning?
Raj VakatiRaj Vakati
You can able to do it like below

https://developer.salesforce.com/docs/component-library/bundle/force:showToast/documentation
 
showMyToast : function(component, event, helper) {
    var toastEvent = $A.get("e.force:showToast");
    toastEvent.setParams({
        mode: 'sticky',
        message: 'This is a required message',
        messageTemplate: 'Record {0} created! See it {1}!',
        messageTemplateData: ['Salesforce', {
            url: 'http://www.salesforce.com/',
            label: 'here',
            }
        ]
    });
    toastEvent.fire();
}