Activity Forums Salesforce® Discussions How to ShowToast duration parameter not working in Salesforce Lightning Web Component?

  • How to ShowToast duration parameter not working in Salesforce Lightning Web Component?

    Posted by Deepak on December 9, 2019 at 2:21 pm

    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;
    }

    Deepak replied 4 years, 3 months ago 1 Member · 0 Replies
  • 0 Replies

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos

Popular Salesforce Infographics