You need to sign in to do that
Don't have an account?
Engine Force
e.force:showToast
Hi I'm trying to follow the example here https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/events_one_demo_load.htm.
Atfter setting it up, I got this error when previewing it by clicking on the preview button:
Something has gone wrong. Unable to get property 'setParams' of undefined or null reference. Please try again.
I think it's the helper js "getContacts" where
var toastEvent = $A.get("e.force:showToast");
if (state === 'SUCCESS'){
toastEvent.setParams({
"title": "Success!",
"message": " Your contacts have been loaded successfully."
});
}
e.force:showToast appears to be a system function. Can someone confirm? Does this function only work on Salesforce1?
Atfter setting it up, I got this error when previewing it by clicking on the preview button:
Something has gone wrong. Unable to get property 'setParams' of undefined or null reference. Please try again.
I think it's the helper js "getContacts" where
var toastEvent = $A.get("e.force:showToast");
if (state === 'SUCCESS'){
toastEvent.setParams({
"title": "Success!",
"message": " Your contacts have been loaded successfully."
});
}
e.force:showToast appears to be a system function. Can someone confirm? Does this function only work on Salesforce1?
https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/ref_force_showToast.htm
I Called the component in the application, and was trying to see the output, And received the error.
try calling the component on Lightning Page/Lightning Record Page etc. It will work.