You need to sign in to do that
Don't have an account?
fiona gentry
How to send a default toast message in Lightning Web component(LWC) as Record Page is Loaded
I need to send a information toast message in Lightning Web component(LWC) as Record Page is Loaded
without any button click or change event
Below link has code but i dont need onclick ,it should show message by default
LWC recipes (https://developer.salesforce.com/docs/component-library/documentation/en/lwc/lwc.use_toast)
How to get this default Toast message in LWC?
Thanks for your help
Fiona
without any button click or change event
Below link has code but i dont need onclick ,it should show message by default
<lightning-button label="Show Info" onclick={showInfoToast}></lightning-button>
LWC recipes (https://developer.salesforce.com/docs/component-library/documentation/en/lwc/lwc.use_toast)
How to get this default Toast message in LWC?
Thanks for your help
Fiona
By Using connectedCallback in lwc, you can achieve this requirment.
Below code will help you.
don't forget to mark it as best answer.
Thank you
All Answers
Try Below Code Please Mark It As Best Answer If It Helps
Thank You!
You can define the toast message inside the connectedCallback() method in the Lightning Web component(LWC) as Loaded without any button click. Please follow this sample code for your reference.
Please mark it as the best answer, if it helps.
Thanks.
By Using connectedCallback in lwc, you can achieve this requirment.
Below code will help you.
don't forget to mark it as best answer.
Thank you