Questions tagged [toast]

A Salesforce UI Event supported in the Lightning Experience and Salesforce1 only. Is used to notify a lightning component of the type of Event that has occurred which can be error, warning, success, or info. It allows the component to display a message when the event occurs.

Filter by
Sorted by
Tagged with
0
votes
0answers
20 views

lightning-record-form onError jest test

I'm looking at writing a jest test for the lightning-record-form to test the error handling, The full function should be onError display a Toast event stating the error message to the user const ...
5
votes
1answer
46 views

pester mode not working for showToastEvent in LWC

I have a Lightning web component (LWC) using showToastEvent. The pester mode is not working right -- I do not see a close icon and it closes automatically in 3 seconds. This answer says to clear the ...
0
votes
0answers
24 views

Lightning : Component hides when toast disappears

I have created a component where I am saving a phone field into setting, but at the time of callback I am showing a toast and when the toast is disappers or when we close it then it hides the ...
0
votes
1answer
31 views

Lightning component error when adding toast to the community

I am just trying to add simple toast component on community page based on picklist value of type field. But I am getting callback error. I am not able to resolve this error. Any help is much ...
0
votes
2answers
55 views

Display Exception message in toast when calling Apex using @wire

I love @wire(ing) LWC properties like import { LightningElement, wire } from "lwc"; import getAccounts from "@salesforce/apex/MyCtrl.getAccounts"; export default class MyComponent extends ...
0
votes
2answers
66 views

How to call toast in apex class?

I have a Apex Trigger on creation of a record that calls an Apex class. The point of a method in the class is to check the current time of user and see if it is within business hours. However, I want ...
0
votes
1answer
181 views

ShowToastEvent notification is not displayed in LWC

I have a problem with Toast Event in Lightning Out App. I don't know why when I click on button "Show notification" - nothing happens. I want to see notification, but it's not showing. HTML file: &...
2
votes
1answer
139 views

How can I test the click of a button that calls an Apex method, and makes the component show a toast?

The component itself, when loaded, queries some data from the database. Then, depending on what it finds, loads the specific template. One of those has a button, which will call the server again, and ...
0
votes
1answer
40 views

handleErrors toast Function not able to find

I want to toast the exception message when the callback is not succssful. as per the guidelines here:- https://developer.salesforce.com/blogs/2017/09/error-handling-best-practices-lightning-apex.html ...
0
votes
1answer
155 views

how to hide toast

We are using a backgroundutilityitem component, where we fire a toast event - https://developer.salesforce.com/docs/component-library/bundle/force:showToast/documentation I know it shows the toast, ...
0
votes
1answer
134 views

Show pop-up or toast or banner in Lightning Service cloud console

We are using omni channel. Goal is to enhance the experience of an incoming call. We want some sort of toast to appear inside console when an agent receives incoming call. So far this is what i have ...
6
votes
1answer
905 views

How to show hyperlink in LWC toast

I have created a LWC that executes a call to the controller and shows a toast message if the call fails: const event = new ShowToastEvent({ title: "Error", ...
0
votes
1answer
144 views

If I run a Component from App then Event like showToast,closeQuickAction,navigateToURL are not working [duplicate]

I am calling Component from App, in that case the Events like showToast,closeQuickAction,navigateToURL are not working. Please find and let me know how can I resolve this Test.app <aura:...
1
vote
1answer
733 views

Lightning toast message is not working in classic

I have created a lighting component and used it in a visualforce page by using lighting out. Is there any way to display the toast message?
0
votes
1answer
299 views

ToastEvent is not working and it's throwing error message [duplicate]

when i clicked on button after saving record it is showing error message that component need to refresh it. i have already refresh it even cookie cache and history also deleted but not showing success ...
0
votes
2answers
4k views

lightning component:toast alert message

hi guys does anyone know how to change my alert message into toast alert message.. please help here my code action.setCallback(this,function(a){ //get the response state var state = a....
0
votes
1answer
2k views

Toast mesage alert for visualforce page

Any help on how to create an toast message alert on my visualforce page <apex:page controller="MycustomSettingController" lightningStyleSheets="true" > <apex:slds /> <div class="slds-...
0
votes
1answer
380 views

How to auto close the toast message only on incoming of new toast message? [closed]

To close the toast message, only when new toast is fired or else it should stick to old toast message.
0
votes
1answer
3k views

Display toast message with buttons in a Lightning Component

Has anyone displayed a toast message with buttons in a Lightning Component? I need to add 'OK' and 'Cancel' buttons to the toast message. This is my code for the toast message: var resultsToast = $...
4
votes
2answers
195 views

How to present JSON via a e.force:showToast event - escaping of curly brackets?

I have been wondering why a string of this form ERROR on search state=ERROR error=[{"message":"System.QueryException: sObject type..."}] displays like this: ERROR on search state=ERROR error=[] ...
0
votes
1answer
1k views

print error message returned by a class in toast [closed]

I have a lightning component which is calling another apex class which in turn is calling anotehr apex class by creating its object. The first class is already returning a value. However, I would ...
3
votes
0answers
646 views

How to create a timed fade out message using force:showToast

So this is pretty simple to create. I have the code: showMessage : function(){ var toastEvent = $A.get("e.force:showToast"); toastEvent.setParams({ mode : "dismissable", ...
1
vote
1answer
80 views

How to avoid scroll to last focused element on Toast close

I'm using a Toast for showing whether a search has successfully completed or not when clicking the "Search" button. My problem is that, when it shows the list of results and I'm scrolling along it, ...
10
votes
4answers
7k views

How to show lightning toast on top of modal (quick action)?

I have created lightning quick action to add my component for some functionality. so from my quick action. When I do some validation like var opp = component.get("v.objOpportunity"); if(!...
2
votes
1answer
2k views

How to add listener for toast notifications?

I want to perform an action when a notification happens in my app. The toast event is raised by SFDC which means I do not have access to the calling code. I have tried adding a handler to the force:...
4
votes
1answer
800 views

Any way to detect that “e.force:showToast” will not be presented?

In the Developer Console Preview the "e.force:showToast" event is available but when fired does not produce any output. (Putting the same components in an App Builder app does produce output.) Is ...
-1
votes
1answer
82 views

How to refocus the Input-Field once the Toast is displayed [closed]

I have an InputField, when the length of the String entered in the InputField becomes 0, it should display a toast and on closing the Toast, the Focus should come back to InputField? Here I am able ...
1
vote
1answer
625 views

force:showToast own implementation

I read a lot of toast in lightning but in standalone app it's not working. In this guide https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/events_one.htm ...} else { //...
4
votes
1answer
3k views

Show lightning toast message in multiple lines

I have a lightning component which I am using for quickaction and I currently show an error message which is passed from the controller as a String. The problem is, I want to show the error message in ...
1
vote
1answer
298 views

Show multiple Toast messages in SF1 stacked

Is it possible to show multiple toast messages in SF1 stacked? When I fire more than one showToast event it displays one after another. But I want to display them all at once in a stacked layout.
9
votes
2answers
3k views

how to show a hyperlink in force:showToast message

How to show the message in hyperlink showToast : function(component, event, helper) { var toastEvent = $A.get("e.force:showToast"); toastEvent.setParams({ "title": "Success!", "message": "...
1
vote
1answer
1k views

Toast event in Lightning not working

Hello I am trying to make a Lightning component common to Community and SF1 . This component has been added as quick action on one of the object detail page. Now when i am using the toast event, it ...