1

We created a LWC to aid our users when navigating Tableau CRM Dashboards hosted in a Digital Experience Site. When users press a button, I want to show the user a toast message. However, this message is never shown.

Looking at the Documentation:

When prefixing the toast with an alert(): the alert is shown, as is a console.log() after the toast (so the toast is fired without errors), but no toast message is shown.

What could be the reason for this?

Controller class:

 handleButtonClick() { 
   callApexController({ // }) 
   .then( result => { 
     console.log('Button Clicked'); // shows in console 
     const evt = new ShowToastEvent({ 
       title: 'Toasty Title', 
       message: 'My message', 
       variant: 'success', 
       mode: 'sticky' }); 
     this.dispatchEvent(evt); // never happens 
     alert('Boom!'); //shows 
   }) 
  .catch( error => { 
     console.log('Something went wrong'); 
     console.error(error); // logs to console correctly 
     const evt = new ShowToastEvent({ 
       title: 'Toasty Error Title', 
       message: 'My Error Message', 
       variant: 'sticky', 
     }); 
     this.dispatchEvent(evt); // never happens 
   }); 
   alert('Boom'); // alert shows 
 } 

From the code you can see that first I write to console, then I want to show a sticky toast that will not go away unless I click it (so I'm not to late during testing), and then I show an alert box. The first and the last actions are all executed, however the middle part that fires the toast does not.

This is observed in Tableau CRM dashboards viewed in Tableau itself, as well as TCRM Dashboards hosted in Digital experience cases (see screenshot). It looks like Toast messages are not implemented in Tableau CRM Dashboard Components, but I cannot find any mention of this in the documentation so it appears like it should work. Am I doing anything wrong?

No Toast shown in Tableau Dashboard Viewer. Other alerts are shown.

No Toast shown in Digital Experience. Other alerts are shown.

2
  • 1
    Have you tried outside of analytics studio? There's a note in this document about lightning events only working when the dashboard is embedded in Salesforce pages (not Analytics studio). Feb 24 at 14:58
  • It works when I embed the component directly in a digital experience page (not in the dashboard itself).
    – xouns
    Feb 25 at 11:36

1 Answer 1

1

Even though it's not mentioned in the documents you linked, it's covered in the following documentation:

As such, lightning/platformShowToastEvent is not supported specifically in Analytics Studio.

Note

If you create a Lightning Web Component that uses Lightning events, the events work when your Tableau CRM dashboard is embedded in Salesforce pages, but not from Analytics Studio. Analytics Studio is a separate Lightning app.

Lightning components that use Lightning events, like force:createRecord or lightning:navigate, are supported in embedded dashboards, but not in Analytics Studio

1
  • So because this is embedded in a Tableau Dashboard, although it is on an Experience Site, the notification will not come through... Thanks, I'll need to talk to a few people then.
    – xouns
    Feb 28 at 8:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.