+ Start a Discussion
BobBob 

Visualforce page with java popup message.

I have a popup message using visualforce and java. I only need the message to popup once during a session but everytime someone clicks away from the record and clicks back the message keeps popping up.  Is there something I can add to my code below that will make this message popup once?

<apex:page standardController="Case">

  <script type="text/javascript">
    var s = "";
    var a = "{!JSENCODE(Case.Account.Alert_Message__c)}";
    if (a.length > 0)
    {
      s += "Account Alert: " + a + "\n";
    }
    
    if (s.length > 0)
    {
      window.alert(s);
    }
  </script>
 
</apex:page>
Ashish_SFDCAshish_SFDC

Hi Bob, 


Use a boolen function and update the code if fired once, if fired again do not enter the loop to execute. 

See some sample code in the link below, 

http://salesforce.stackexchange.com/questions/34328/view-pop-up-data


Regards,

Ashish