Take the 2-minute tour ×
Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It's 100% free, no registration required.

I would like that depending on some criteria's (checkbox, date, name, value) of a certain field/custom field, on an object. Once that object loads, a popup window will appear. an OK button is sufficiant.

enter image description here

It can be also like the html pop up for tasks overdue alerts.

share|improve this question

4 Answers 4

up vote 2 down vote accepted

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.

share|improve this answer
    
well, I don't understand how I combine the two. I guess it has nothing to apex, but never added a JS to a SF page. can you please show me how? –  Saariko Aug 16 '12 at 7:02

I guess you want the popup alert on the detail page. Well, in that case, please create a VF page with standardController set as your object and then paste the above code given by Matt and then with page layout, add this page on the detail page. And then make the width and height as small as you can.

Thanks, SP

share|improve this answer

its something we all come across, but I believe you can execute standard Javascript on VFPages, you might want to check out the Previous post on using Jquery in Visual Force or I would highly recommend you to check this documentation

Let us know if this helped you out

share|improve this answer
    
I'm a fan of using jQuery + BlockUI in these scenarios: blogs.developerforce.com/developer-relations/2012/05/… –  joshbirk Dec 12 '12 at 18:56

So Laceys full code would be

<apex:page StandardController="Contact">

<script>

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

</apex:page>

You need to create this, then add the Visualforce page via your pagelayout on the appropriate object, in this case Contact. As Shailesh said be sure to make this as small as possible (1px) because it serves no other function than to act as a pop-up

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.