You need to sign in to do that
Don't have an account?
Joseph Simpson 7
How to display an LWC Toast Message conditionally after save.
Hello. I'm a new LWC developer and need some assistance if possible.
I have a requirement to fire a toast message after a user changes a picklist field value in the record detail of an Opportunity and clicks save. I created the toast in LWC but don't know how to fire it upon save when this condition is met.
There is a lot of great information on how to fire toast messages upon a button click or when a field value is changed within an LWC. However, I can't find anything on how to fire the toast when a user makes a change in the standard record detail page and saves. Is there an if/then statement in the javascript that can be used or conditional rendering in the html? I need the toast to appear any time this picklist field value is changed and the record saved. Thanks so much!
I have a requirement to fire a toast message after a user changes a picklist field value in the record detail of an Opportunity and clicks save. I created the toast in LWC but don't know how to fire it upon save when this condition is met.
There is a lot of great information on how to fire toast messages upon a button click or when a field value is changed within an LWC. However, I can't find anything on how to fire the toast when a user makes a change in the standard record detail page and saves. Is there an if/then statement in the javascript that can be used or conditional rendering in the html? I need the toast to appear any time this picklist field value is changed and the record saved. Thanks so much!
Your question is quite similar to : https://developer.salesforce.com/forums/?id=9062I000000DLHqQAO , you can try anyone of the 2 solutions mentioned in the link.
Or in LWC wire you can query last modified filed and if the last modified is in minute difference is less than 1 , then you can show the logic for toast message.
Hope this helps.
Thanks,
karthik
All Answers
Your question is quite similar to : https://developer.salesforce.com/forums/?id=9062I000000DLHqQAO , you can try anyone of the 2 solutions mentioned in the link.
Or in LWC wire you can query last modified filed and if the last modified is in minute difference is less than 1 , then you can show the logic for toast message.
Hope this helps.
Thanks,
karthik
Great to hear that it helped :) , kindly mark the previous comment as best answer so the question can be close.
Thanks,
Karthik