-
How to ShowToast duration parameter not working in Salesforce Lightning Web Component?
handleToast(){
if(this.showToast){
//console.log('calling case comments');
getCaseComment({caseId: this.recordId})
.then(result => {
if(result){
this.dispatchEvent(
showToast('Info','pester', 'Latest Case Comment', result, 75000)
);
}
})
.catch(error => {
console.log('Error occured in showing case comments'+error);
});
}
}/**
* showtoast event
* @param variant
* @param mode
* @param title
* @param message
* @returns {ShowToastEvent}
*/
const showToast = (variant = 'info', toastMode = 'dismissable', title, message, toastduration) => {
//console.log('dutaion receved >>'+toastduration);
const event = new ShowToastEvent({
title: title,
duration : toastduration,
message: message,
variant: variant,
mode : toastMode
});
return event;
}
Log In to reply.
Popular Salesforce Blogs

How Can Nonprofits Protect Their Data? | Salesforce Nonprofit Cloud
Security breaches that are both likely to arise and have the potential to cause significant harm are classified as prime importance. Many nonprofit organizations collect…

The Top Reasons to Invest in Salesforce Professional Services
In today's business world, technology is a big deal, and when it comes to making things work better, Salesforce is like the superhero of software.…

Cache Lightning Platform Data - Salesforce Developer Guide
Using the Platform Cache can enable Salesforce applications to run faster because they will store reusable data in memory. Salesforce applications can easily and quickly…
Popular Salesforce Videos
Workplace Command Center | Salesforce
Protect employees and customers with safer workplaces. Use our Workplace Command Center to quickly take action on workplace safety.
What is Record Types in Salesforce?
Record Types is where you have multiple page layouts to a specific profile. Watch this video to learn all about it.
Manage Packages & Post Installation Script | Salesforce Managed Packages
This video will give you a brief overview of Managed Packages and Unmanaged Packages in Salesforce. You will get a quick glance at how to…
Popular Salesforce Infographics

7 Must Know Features on the New Salesforce AppExchange
The AppExchange is an online marketplace for Salesforce apps, components, and consulting services. If you're a Lightning Platform developer or consultant, the AppExchange is the…

Explore The Salesforce Support Services Process Chart
This infographic helps you to explore the Salesforce Services process chart. Go through it and let me know in the comments in case of any…

Salesforce Buy Vs Salesforce Build - An Infographic
Uncover the Process that every business should understand at the time of Salesforce implementation and integration. Salesforce Solution Buying Process Search for Required Solution on…