You need to sign in to do that
Don't have an account?
Desai
>= not working in VF Page
Hi ,
On VF page , we are giving the below condition for required attribute ,
<apex:inputField value="{!cr.Contact.DOB__c}" label="Date of Birth" required="{!IF(cr.Contact.Primary_Officer_Percent__c >= 25, true, false)}" >
but when the page is loaded we get the below error,
The value 'null' is not valid for operator '>='
Error is in expression '{!IF(cr.Contact.Primary_Officer_Percent__c >= null, true, false)}' in component <apex:inputField> in page jhcustomform
is it because cr.Contact.Primary_Officer_Percent__c is null when the page is loaded ? If yes is there any other way to do this ?
Thanks
On VF page , we are giving the below condition for required attribute ,
<apex:inputField value="{!cr.Contact.DOB__c}" label="Date of Birth" required="{!IF(cr.Contact.Primary_Officer_Percent__c >= 25, true, false)}" >
but when the page is loaded we get the below error,
The value 'null' is not valid for operator '>='
Error is in expression '{!IF(cr.Contact.Primary_Officer_Percent__c >= null, true, false)}' in component <apex:inputField> in page jhcustomform
is it because cr.Contact.Primary_Officer_Percent__c is null when the page is loaded ? If yes is there any other way to do this ?
Thanks
thanks DeveloperSud
All Answers
check the data type of the filed Primary_Officer_Percent__c.If that field is Boolean or checkbox then the above expression will not work.
thanks DeveloperSud
Hi Desai,
Please try the below code:
required="{!IF(((cr.Contact.Primary_Officer_Percent__c >=0), true, false)}"
// value depend on the type of Custom Field " Primary_Officer_Percent__c"
//if number then use Integer value >=0
//if String then use !=null
if you found this answer helpful then please mark it as best answer so it can help others.
Thanks
Akshay