You need to sign in to do that
Don't have an account?
Display alert with visual force page when two picklist fields are null
I am trying to display an alert with a visual force page when two picklist fields are null. Here is my code, which is not working:
<apex:page standardController="Lead" rendered="{!NOT(ISNULL(TEXT(Lead.Egg_Donor_Status__c)))} && {!NOT(ISNULL(TEXT(Lead.Sperm_Donor_Status__c)))} " >
<script type="text/javascript">
{
window.alert("Please request that Client send a copy of their Donor Eligibility document.");
}
</script>
</apex:page>
I get the following error:
Error: Donor_Eligibility_Paperwork_Alert line 1, column 96: Element type "apex:page" must be followed by either attribute specifications, ">" or "/>"
Error: Element type "apex:page" must be followed by either attribute specifications, ">" or "/>".
I am basing this code on a tip found here: https://developer.salesforce.com/forums/?id=906F000000097KLIAY
<apex:page standardController="Lead" rendered="{!NOT(ISNULL(TEXT(Lead.Egg_Donor_Status__c)))} && {!NOT(ISNULL(TEXT(Lead.Sperm_Donor_Status__c)))} " >
<script type="text/javascript">
{
window.alert("Please request that Client send a copy of their Donor Eligibility document.");
}
</script>
</apex:page>
I get the following error:
Error: Donor_Eligibility_Paperwork_Alert line 1, column 96: Element type "apex:page" must be followed by either attribute specifications, ">" or "/>"
Error: Element type "apex:page" must be followed by either attribute specifications, ">" or "/>".
I am basing this code on a tip found here: https://developer.salesforce.com/forums/?id=906F000000097KLIAY
There is some problem in the rendered attribute.As it seems the formual is not correct. If you use TEXT(Lead.Egg_Donor_Status__c) this will not work as the picklist field values are TEXT (String) only.You can see the below link for more reference .I think in rendered attribute you can use the below check :- rendered="{!NOT(ISNULL(Lead.Egg_Donor_Status__c))} && {!NOT(ISNULL(Lead.Sperm_Donor_Status__c))} "
Please let us know if this works and mark it as solved if it helps.
https://developer.salesforce.com/forums/?id=906F00000008lnbIAA
All Answers
can you tell me the data type of these two fields Egg_Donor_Status__c and Sperm_Donor_Status__c ? Are those text fields?
There is some problem in the rendered attribute.As it seems the formual is not correct. If you use TEXT(Lead.Egg_Donor_Status__c) this will not work as the picklist field values are TEXT (String) only.You can see the below link for more reference .I think in rendered attribute you can use the below check :- rendered="{!NOT(ISNULL(Lead.Egg_Donor_Status__c))} && {!NOT(ISNULL(Lead.Sperm_Donor_Status__c))} "
Please let us know if this works and mark it as solved if it helps.
https://developer.salesforce.com/forums/?id=906F00000008lnbIAA