window.onload = throwalert; this does check the box any ideas?", "answerCount": 3, "upvoteCount": 0, "datePublished": "2016-05-25T20:04:06.000Z", "author": { "@type": "Person", "name": "Pooja Nekkalapudi", "url": "https://trailblazers.salesforce.com/profileView?u=0053000000CT0fcAAD", "affiliation": { "@type": "Organization", "name": "William Blair and Company" } }, "acceptedAnswer": { "@type": "Answer", "text": "Hi Pooja,   This Answers Community is focused on configuration and design questions. Programmatic questions are best submitted to the developer forums at   http://salesforce.stackexchange.com   https://developer.salesforce.com/forums   where the forums and participants are geared toward programming troubleshooting and support.    ", "upvoteCount": 0, "url": "https://trailhead.salesforce.com/trailblazer-community/feed/0D54S00000A8bBlSAJ", "datePublished": "2016-05-25T20:25:18.000Z", "author": { "@type": "Person", "name": "Naval Sharma", "url": "https://trailblazers.salesforce.com/profileView?u=0053000000BMq7jAAD", "affiliation": { "@type": "Organization", "name": "Aptclouds Software Solutions" } } }, "suggestedAnswer": [ { "@type": "Answer", "text": "Hi,   This Answers Community is focused on configuration and design questions. Programmatic questions are best submitted to the developer forums at https://developer.salesforce.com where the forums and participants are geared toward programming troubleshooting and support.   Hope this helps !!   --   Thanks,   Swayam", "upvoteCount": 0, "url": "https://trailhead.salesforce.com/trailblazer-community/feed/0D54S00000A8bBlSAJ", "datePublished": "2016-05-25T20:27:30.000Z", "author": { "@type": "Person", "name": "Swayam Chouksey", "url": "https://trailblazers.salesforce.com/profileView?u=0053000000Bo1AAAAZ", "affiliation": { "@type": "Organization", "name": "mindZvue LLC" } } } ] } }
Skip to main content
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?
3 risposte
0/9000