function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Pooja NekkalapudiPooja Nekkalapudi 

How to pop up a alert

How to pop up a alert and have a check box "is alert shown " update to true once the user reads the pop - up 
so far i have 
class:
public class PopUpAlert
{
public Opportunity opp;

  public PopUpAlert(ApexPages.StandardController controller){

   Opportunity opp = (Opportunity)controller.getRecord();
    opp=[select id,isAlertShown__c from Opportunity where Id=: opp.ID];
    
  }
  public void setAlertVal(){
opp.isAlertShown__c = true;
 update opp;
  }
}
VFpage:
<apex:page standardcontroller="Opportunity" extensions="PopUpAlert" >
<html><head>
<apex:form > <apex:actionFunction name="setAlertVal" action="{!setAlertVal}" />
<script type="text/javascript"> var msg="FYI test : confidential info";
if ( {!Opportunity.isAlertShown__c} == false)
{
alert(msg); setAlertVal();
} </script> </apex:form> </head>
window.onload = throwalert;
</html> </apex:page>

this does check the box
any ideas?