You need to sign in to do that
Don't have an account?
Alessandro Patricelli 9
showToast on VisualForce Page isnt working? Help
Hi All,
I am trying to make a VisualForce page that on Load it show a simple JS Toast..
But i am keeping getting the following error:
Uncaught ReferenceError: sforce is not defined
at showToast
This is my Visual Force Page, what i am doing wrong?:
<apex:page standardController="Account" lightningStylesheets="true" >
<script type="text/javascript">
window.onload = showToast();
function showToast() {
sforce.one.showToast({
"title": "Attenzione",
"message": "Test Message.",
"type": "warning"
});
}
</script>
</apex:page>
Thanks for help :) really apprecciated.
I am trying to make a VisualForce page that on Load it show a simple JS Toast..
But i am keeping getting the following error:
Uncaught ReferenceError: sforce is not defined
at showToast
This is my Visual Force Page, what i am doing wrong?:
<apex:page standardController="Account" lightningStylesheets="true" >
<script type="text/javascript">
window.onload = showToast();
function showToast() {
sforce.one.showToast({
"title": "Attenzione",
"message": "Test Message.",
"type": "warning"
});
}
</script>
</apex:page>
Thanks for help :) really apprecciated.
According to your solution, you can not use toast on the web page because it is standard toast. You can use this in your developer org. So you can show the toast. Otherwise, there is a second option to show the toast on the web page that is custom toast you have to make a custom toast to show Like this:
Thank you!
Regards
Suraj Tripathi