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
Cynthia Rodgers 12Cynthia Rodgers 12 

Popup alert message that validates if a field is populated

I need some assistance with a popup alert I created for one of my case record types.  I want the alert to fire when a custom field (Wire to) is populated only.  What is currently happening is the alert is popping at every edit of the record, even when this field is not populated.  

I need the alert to validate when the Wire to field is not null and then display the message.

VF Page
 
Best Answer chosen by Cynthia Rodgers 12
Maharajan CMaharajan C
Hi Cynthia,

Please use the below VF Code:

<apex:page standardController="Case" rendered="{!Case.Wire_to__c<>null}">
<script type ="text/javascript">
{
window.alert("Please Attach Approved Wire Forms");
}
</script>
</apex:page>

And also refer this link friend which have the step by step Procedure:
http://pranavmarathe.blogspot.in/2011/06/simple-pop-up-alert-in-salesforce.html

Can you please Let me know if it works or not!!!

If it helps don't forget to mark this as a best answer!!!

Thanks,
​Raj

 

All Answers

Maharajan CMaharajan C
Hi Cynthia,

Please use the below VF Code:

<apex:page standardController="Case" rendered="{!Case.Wire_to__c<>null}">
<script type ="text/javascript">
{
window.alert("Please Attach Approved Wire Forms");
}
</script>
</apex:page>

And also refer this link friend which have the step by step Procedure:
http://pranavmarathe.blogspot.in/2011/06/simple-pop-up-alert-in-salesforce.html

Can you please Let me know if it works or not!!!

If it helps don't forget to mark this as a best answer!!!

Thanks,
​Raj

 
This was selected as the best answer
Cynthia Rodgers 12Cynthia Rodgers 12
Thanks Maharaja C!  I just tested the case record and it is validating on the field.  Thank you again.
Felix Linden 2Felix Linden 2
Hello Maharaja,
I used your visualforce code and it works perfectly. However, I have to extend the code:

I need a bigger pop-up alert and a colorfull - lets say red.

How can I adjust the pixel size of the pop-up + size of font and how can I set the background color?

Thanks,
Felix
Vanessa Norcliffe 15Vanessa Norcliffe 15
I have followed the instructions and I'm not getting the pop up note to work:
1.  ceated a visual force page with this code:
  User-added image
2.  Navigated to Setup, Objects and Fields, Object Manager, Account (Label is "Entity"), Page Layouts
3.  Chose the approriate layout that we wish to invoke this popup when "Account.Description" field is null and added the visual force page to that layout within the section that holds the Account.Description field

We are using Lightning experience.

Any help is greatly appreciated!

Thank you
Vanessa