+ Start a Discussion
acrozieracrozier 

Making popup display when field is NOT NULL

I am using the following code to create a popup on the Account page when a custom field is NOT NULL

 

<apex:page standardController="Account" rendered="{!Account.Facility_SOPs__c==null}">
 <script type="text/javascript">
     {
         window.alert("Please review Facility SOPs: {!Account.Facility_SOPs__c}");
     }
 </script>
</apex:page>

 If I remove the second = making the redered=NULL the popup will be displayed on accounts where the field is null.  I need the opposite to happen, but it doesn't appear to work when I designate NOT NULL using ==

Best Answer chosen by Admin (Salesforce Developers) 
stunaitestunaite

rendered="{!NOT(ISNULL(Account.Facility_SOPs__c))}"

All Answers

stunaitestunaite

Use this instead:

 

rendered="{!ISNULL(Account.Facility_SOPs__c)}"

acrozieracrozier

that doesn't seem to work either.  Any other suggestions?

stunaitestunaite

rendered="{!NOT(ISNULL(Account.Facility_SOPs__c))}"

This was selected as the best answer
acrozieracrozier

that did it, thank you.

acrozieracrozier

are you aware of anyway to remove the text at the top of the popup box that says: The page at http://cs3 says:

stunaitestunaite

Yes but all ways will give you too much work. It is not worthy the time.

 

check this: 

 

http://stackoverflow.com/questions/1905289/how-to-edit-a-javascript-alert-box-title

acrozieracrozier

Can i call to Google's CDN for JQuery, or do I have to import it as a static resource?  The below code is not working.

 

<apex:page standardController="Account" showHeader="true" >
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js" />
<script type="text/javascript">

    jAlert('<b>Facility:</b> {!Account.Facility_SOPs__c}', 'SOPs');

</script>

</apex:page>

 

acrozieracrozier

nevermind.  I see now that jalert is an extension to jquery, not native functionality.

acrozieracrozier

How can I render based on any one of three fields being NOT NULL using the method that was given to me above...

 

rendered="{!NOT(ISNULL(Account.Facility_SOPs__c))}

"