Hot answers tagged

2

The short answer to this is "no, you cannot trigger a toast from Apex". This is because Apex is a server-side language and toasts must be launched from the front-end. However, as @glls answer says, you can make a call to Apex, interpret its result, and then trigger a toast based on what results are. This is a very common pattern with errors, for example, ...


1

Normally, toasts are something that you do on the client, yes, you can trigger it with apex, you just need to have the apex class be invoked from the client and return a response that can be handled by your client side controller in order to trigger a toast you will have to use an @AuraEnabled decorator on your apex method and handle the response ...


1

As you can see here platformShoToastEvent can only be used in Lightning Experience explicitly. Since standard toasts are based on Appliacation Events there is nothing to handle your event in Lightning OutApp. So what usually happens with toast events? You dispatch an event which is most probably set to propagate outside shadow DOM boundary (see ...


Only top voted, non community-wiki answers of a minimum length are eligible