• Alessandro Patricelli 9
  • NEWBIE
  • 0 Points
  • Member since 2021

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 0
    Replies
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.
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.