Activity Forums Salesforce® Discussions Can I create a popup/alert window/message when a SF page loads?

  • Ajit

    Member
    April 30, 2016 at 4:37 pm
  • Gourav

    Member
    June 1, 2016 at 10:03 am

    Is there a reason that you can't use a standard javascript alert? Here is a 'complete' VisualForce page using such a popup:

    window.document.onload = new function(e)
    {
    if({!Contact.Some_Checkbox__c})
    {
    alert("Checkbox is True");
    }
    else
    {
    alert("Checkbox is False");
    }
    }
    </script>

     

    If the custom checkbox field 'Some Checkbox' on the contact record used in the URL (which would be "http://someinstance/apex/ThePage?id=") the popup will say 'Checkbox is True' and vice versa.

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos