function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Shubham Sinha 56Shubham Sinha 56 

How to create a lightning modal or toast message

Hello ,

I have a requirement where i need to show a modal/popup/ toast message whenever a lead status is changed to working. When a status is changed to working at that time only that popup or modal or message should be displayed.
Title - Your lead is in working status now.
Plese help me in order to cater this requirement.Thanks in advance
 
Erwin DavidErwin David
title Specifies the toast title in bold.
message Specifies the message to display. 
messageTemplate Overwrites message string with the specified message. 
messageTemplateData An array of text and actions to be used in messageTemplate.
key String Specifies an icon when the toast type is other. Target MyBalanceNow (https://www.mybalancenow.buzz/)
AbhinavAbhinav (Salesforce Developers) 
Hi Shubham,

You can refer below link to display custom user message in standard lightning page.

http://www.sfdcpanda.com/custom-user-message-in-standard-lightning-page/

Thanks!
Suraj Tripathi 47Suraj Tripathi 47

Hi Shubham Sinha 56,

Greetings!

To create modal in lightning go through this link,
https://sfdcmonkey.com/2017/04/15/modal-box-lightning-component-salesforce/

and to create a Toast message use this code in your javascript function:
 

var toastEvent = $A.get("e.force:showToast");
        toastEvent.setParams({
            "title": "Your lead is in working status now",
            "type": "success"
        });
        
        toastEvent.fire();
 

If you find this helpful mark it as the best answer

Thank you!
Regards,
Suraj Tripathi

mukesh guptamukesh gupta
Hi Shubham,
 
Please use below code

if (leadStatus ==  "working) {
 this.leadStatusChanged();
}

 
leadStatusChanged : function(component, event, helper) {
        var toastEvent = $A.get("e.force:showToast");
        toastEvent.setParams({
            title : 'Your lead is in working status now',
            duration:' 5000',
            key: 'info_alt',
            type: 'success',
            mode: 'pester'
        });
        toastEvent.fire();
    },


if you need any assistanse, Please let me know!!


Kindly mark my solution as the best answer if it helps you.

Thanks
Mukesh
Shubham Sinha 56Shubham Sinha 56
Hi Mukesh,

How to use this condiotions and where 

if (leadStatus ==  "working) {
 this.leadStatusChanged();
}