How to create e.force:showToast whith link - Domreysa

Post Top Ad

Post Top Ad

Tuesday, November 5, 2019

How to create e.force:showToast whith link




In your controller
showToast: function (type, message) {
        var toastEvent = $A.get('e.force:showToast');
        var mode = 'dismissible';
        var duration = 3000;
  if (type === 'error') {
            duration = 20000;
        }
  toastEvent.setParams({
            type: type,
            mode: mode,
            duration: duration,
            message:"You Message",
            messageTemplate: "The record '{0}' has been updated successfully.",
            messageTemplateData: [{
                label:"#123456",
                url: "/Your record Id"
            }]
        });
        toastEvent.fire();
    }

No comments:

Post a Comment

Post Top Ad

Responsive Ads Here