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
1answer
18 views

Display Toast Message only once after login on Home Page

Is it possible to display toast message notification only once when user login to system on a home page? I don't want toast message appear every time if I navigate to home page multiple time? Wanted ...
1
vote
0answers
23 views

Close Toast Message with messageData on hyperlink click - lwc

I have a toast message in lwc that uses sticky mode (does not go away until the user click on close symbol) and also messageData (to add a hyperlink in the toast for the user to click on). The thing ...
1
vote
1answer
17 views

Error in $A.getCallback() [Cannot read property 'setParams' of undefined] Callback failed When Dismissing Alert Message

I created and displayed a custom list button in standard Lead list view. This references a Visualforce page. Clicking this button makes an action, and there's nothing wrong with the results in the ...
0
votes
0answers
13 views

Popup to be displayed on uploading duplicate file in the Notes and Attachment under Account Object

I have a requirement where I need to warn the user if they are uploading duplicate files against a particular Account record. The file will be uploaded, only need to show them a Warning message. I ...
1
vote
1answer
73 views

Standard lwc lightning/platformShowToastEvent module and force:showToast aura event don't work in Lightning Community

We have community with Registration Page replaced with custom Lightning Community Page. The page is build with Aura component, which is using lwc components. Trying firing force:showToast from aura ...
0
votes
1answer
174 views

How to display toast or custom error message with in quick action

Currently, I'm working on lightning migration & i have a custom javascript button named convert. This button will display multiple toast messages based on record criteria. Everything working as ...
1
vote
1answer
53 views

How to show the date variable in the toast message in LWC

Hi how can show the value of the field in the LWC toast message which contains the date. I am trying to show but getting the value as undefined. JS code: @track MDate ===2020-07-15 @track StDate === ...
0
votes
2answers
302 views

Validation rule Error message not displaying in LWC UpdateRecord toast event

I have a record which I'm updating via the UpdateRecord method from LWC, using Toast events to display success or error messages, which all works fine. What I'm not getting though, when there's a ...
0
votes
1answer
125 views

Display Link of Inserted Record Id in Toast in Salesforce LWC [duplicate]

I have a page which displays a toast message upon successfully inserting a custom object record. I think it would be appropriate to add the record id, so when I click on it, it will redirect to the ...
0
votes
0answers
49 views

Error message need to display on custom Toast message

In Javascript i am catching the error and displaying it on console.log succesfully, but how can i save this error message in a variable and use it in my custom toast message ? Code in JS : Where i am ...
0
votes
1answer
86 views

How to set the width of Toast message box in lightning component

I have a requirement where field value from long text field called Alert_Text_Timeline__c will be displayed as toast message on click of a button. Below is my code Component: <aura:component ...
0
votes
2answers
159 views

How to display Toast message with custom field value as its message

I have a requirement to display message toast on detail page when any record is opened. This message will be from a custom field (Alert_Text__c) on Account which is a text field. Below is the code to ...
0
votes
1answer
38 views

Lightning Toast moving screen to top of page

I have a normal toast event on a lightning component that is halfway down a page that consists of several lightning components. When the toast event fires, the toast appears and once it is closed the ...
0
votes
0answers
14 views

Component not getting refreshed until user clicks somewhere in Lightning Component

I have aura-if sections in my lightning component which shows a pop-up if user click on edit for any record which is working fine. In pop-up, I have a button on click of which it does some processing ...
2
votes
2answers
427 views

How can I show a LWC ToastEvent message in Visualforce?

I have an LWC component which has multiple showToastEvents which works in Lightning Exp without any issue. But when I am calling the same LWC component from a VF page, I am not able to see toastevent....
0
votes
1answer
57 views

In Aura Component,Can I Call a local method in toast?

a.cmp <aura:component > //... <lightning:button label="looks" onclick="{!c.initDialog}" /> //... </aura:component> controller.js initDialog: function (component, ...
0
votes
1answer
582 views

LWC: How to Use Wire Method and ShowToast correctly

So I've got a project that uses a screen flow to update opportunities with a related payment record. Once the record is linked to the opp, I have a lightning component that displays summary data of ...
1
vote
1answer
180 views

Toast is not firing from the lightning component

I am trying to show the toast on the screen after the field is updated using the lightning component the Controller looks like below Controller ({ recordLoaded: function(component, event, helper)...
0
votes
1answer
107 views

showToast from messageCallback function of empApi

I have an empApi subscription to a Platform Event. When that event fires, I want to pull data from its fields and showToast. I'm copying the code straight from the docs, and I can get the platform ...
1
vote
1answer
182 views

lightning Toast message in LWC in Visual force page is not working

lightning Toast message is not showing when i click on save button. Is that anything wrong in the below code. Please help me on this. <div class="slds-size_2-of-2"> <lightning-button type="...
1
vote
0answers
86 views

Catching and relaying show toast event

We want to use Lightning toasts from Lightning Out. We want to do this using the standard new ShowToastEvent approach, so our components will work identically either in Lightning Experience or ...
1
vote
1answer
250 views

LWC: Slide an element in and out

I'm building a Lightning Web Component for a standalone Aura app where ShowToastEvent isn't available. I've seen an example of a custom LWC toast component that shows and hides itself using slds-show ...
1
vote
4answers
230 views

LWC: Show Toast from Service component

I need to show toast from LWC service component, but I don't have and won't have any instance of LWC component. That means no class which extends LightningElement. This service will be used in Aura ...
0
votes
0answers
129 views

toast message with “undo” button

I need recreate the toast message in standard components with the "undo" button that appears when you delete a record. Is that possible in a custom component? for example: var actions = component.get(...
0
votes
1answer
54 views

How to fire appEvent after toastEvent in lightning controller

I have an appEvent on a child controller to update a parent method after a toast. I have set an alert on the parent in the parent method to figure out if my event is working properly. My alert shows ...
1
vote
3answers
806 views

Call toast notification in LWC from within fetch method

EDIT: I originally left out a part of my code which I thought was irrelevant to the question but on further investigation realized it was the source of the issue. Adding it in and then will also add ...
0
votes
0answers
211 views

toast error message showing up two times

based on a field value as null on account I'm showing up a toast error message as below: if(field == null) { console.log('comin inside field null') var resultsToast = $A.get("...
2
votes
1answer
769 views

How to show toast message in multiple lines in a Lightning Web Component

I have a requirement where I need to display my toast message in multiple lines in my LWC. I tried using \n and but they are not working. Please assist.
0
votes
1answer
165 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
228 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
1answer
177 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
2k 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
2k 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 ...
1
vote
2answers
4k 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
2k 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
99 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
636 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
571 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 ...
8
votes
2answers
3k 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", ...
1
vote
1answer
2k 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
781 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
11k 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
5k 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
539 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
4k 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 = $...
5
votes
2answers
290 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 ...
5
votes
1answer
1k 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
219 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, ...
11
votes
4answers
11k 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(!...