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
2 votes
1 answer
91 views

Toast message not fired in LWC

I have the written the following code which creates a contact record and fires a toast message on successful creation of the record. The problem with the code is the record is created but the toast ...
  • 97
0 votes
0 answers
186 views

How to Jest file upload

I am stuck with Jest testing of file resize/upload logic. This is a simple job to resize uploaded image and add it to the Notes & Attachments based on recordId. It is not a production code - it ...
0 votes
2 answers
210 views

How to display toast/alert with in the component

I have a aura component with in the opportunity detail page and i'm trying to display toast/ alert message with in the component.Is there any way to display toast/alert message with in the component ...
  • 1,473
0 votes
1 answer
472 views

Pass values from Apex Script to LWC JS [duplicate]

I have built an LWC Component to display a Toast message without clicking a button. I plan to add this to our Portal so we can display custom messages. I have created a Custom Object, ...
0 votes
1 answer
381 views

Handling Missing Required Fields in LWC Component

There is a LWC that has been built for custom approval cases on the opportunity object. Recently we have made a view fields on the opportunity object as required fields. There are some older records ...
0 votes
0 answers
181 views

listen to standard Toast message in a LWC cmp

In my Opportunity flexi page, I have related list of Event on the right hand panel, all in a same flexi page. When I make changes/add a record to Event, I need to initialize a pop modal which is ...
0 votes
2 answers
227 views

Unable to show salesforce id in Toast Message

I am trying to create a record in an object and on record creation I want to display the salesforce id of that particular record on the toast message. If I comment out the "message: "New ...
  • 174
1 vote
1 answer
157 views

Lightning Toast Message in Tableau CRM LWC Components

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 ...
  • 125
2 votes
2 answers
397 views

Unable to print Error toast message

Hope you're doing well. I want to print an error toast, the pop-up appearing but the message is not printing. I researched and tried a lot about that but was unsuccessful. Below is my JS controller. ...
0 votes
1 answer
2k views

Display toast notification without button click using LWC

Here is the logic which is working fine while using the button, but I'm trying to display the notification once the page is loaded. this logic which I tried, js: import { LightningElement,wire,track } ...
1 vote
1 answer
291 views

Do we have any character limit for the message we display in toast pop up using force:showToast?

do we have any character to the message attribute in force:showToast interface? How many charcters can we display if there is a limit?
0 votes
1 answer
393 views

LWC Jest testing toasts

I'm having an issue with testing toasts. I have read a lot about this thanks to google and followed the instructions but I can't seem to test my toast. When I step through the test, I have a ...
  • 35
0 votes
1 answer
238 views

Custom notification for all user on the record page [closed]

I need to create a notification for the object record page. The idea is that there are two or more users on the record page. When one of them changes record status, toats message must be shown for ...
  • 47
0 votes
0 answers
296 views

toast message is not displaying on some profiles

I created quick actions that will check some criteria and display toast messages accordingly. It is working fine for system admin and some non-sys admin profiles, but failing on some other custom ...
  • 6,676
0 votes
1 answer
332 views

Display HTML in a Toast Popup Alert

Is there any way to display HTML in a Toast popup? I'd like to display a list of error messages, and not just a single string.
  • 531
3 votes
2 answers
2k views

Display error in toast from imperative call

I am trying to show the error message from the apex method exception as a toast message while doing imperative call in lwc. I am using ldsUtil.js to simplify the error message. But either way, I am ...
  • 325
0 votes
2 answers
812 views

LWC showToast not working after apex callout

Hope all you are really well! (have just signup here) I have LWC which is nested in an Aura component. I'm calling imperatively an apex method which executes a REST call: createClientOnMoloni({ ...
0 votes
1 answer
889 views

Display static warning message upon LWC's creation

Is it possible to display a warning toast event msg whenever a component is created? Basically, without triggering it in any way, like with a btn click. .js showMsg(){ const evt = new ShowToastEvent({...
0 votes
1 answer
1k views

Display a Toast message if a checkbox is TRUE

I've been trying to figure out if it is possible to show a toast message on a contact record if a checkbox is true (or if a text field is not blank). I just want the toast message to show once the ...
  • 23
1 vote
0 answers
84 views

How can we override standard Salesforce Lightning message?

We have custom logic to assign opportunity owner, when the User manually try to change the owner Apex code kicks in and assign the owner according to the logic. Still Lightning Users are getting the ...
0 votes
0 answers
119 views

Weird Context Behaviour in LWC and Apex

I'm writing a simple 'Merge Lead and Opp' lwc that leverages apex to transfer some custom fields from the lead to the opp before deleting the lead. The apex works fine. The issue is that when the apex ...
0 votes
1 answer
825 views

How to open VF page in separate tab or popup window from Aura Component

I have created a VF page which display tooltip information and I want to display those tooltip in separate window or separate popup window during record creation. I have referred below link to open VF ...
0 votes
1 answer
2k views

toast message not appearing when triggered from flow

I have a lightning flow embedded in the case record page where I collect some dummy data from input screen and fire the toast message from Flow . I have created the aura component and called the aura ...
  • 175
0 votes
1 answer
1k 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 ...
2 votes
0 answers
825 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 ...
  • 53
0 votes
2 answers
311 views

How to show LWC multi-line toasts?

Does anyone know how to implement multi-line with LWC ShowToastEvent? I can only see workarounds using Aura but not LWC.
  • 533
1 vote
1 answer
1k 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 ...
  • 321
2 votes
1 answer
647 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 ...
  • 25
0 votes
2 answers
5k 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,473
1 vote
1 answer
662 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 === ...
  • 13
3 votes
6 answers
7k 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 ...
  • 1,409
0 votes
1 answer
1k 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 ...
  • 321
0 votes
1 answer
784 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 ...
  • 73
0 votes
2 answers
3k 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 ...
  • 73
1 vote
1 answer
218 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 ...
  • 491
2 votes
2 answers
3k 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
1 answer
305 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, ...
2 votes
1 answer
2k 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,318
1 vote
1 answer
911 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)...
  • 609
0 votes
1 answer
579 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
1 answer
1k 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
0 answers
342 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
1 answer
2k 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
4 answers
420 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
0 answers
264 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
1 answer
199 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 ...
  • 2,194
1 vote
3 answers
2k 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 ...
  • 65
0 votes
0 answers
568 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("...
  • 261
3 votes
2 answers
3k 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.
1 vote
1 answer
450 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 ...