+ Start a Discussion
karthick S 28karthick S 28 

If condition on Fieldset

Hi All,

am having one filedset contains 10 fileds, am displaying that fields in vf page.
So when im displaying that 10 fields i need to hide 1 field out of 10 fields using rendered and if statement.

How can i achieve this requirement. Please help.
GulshanRajGulshanRaj
You can use if condition inside rendered like this way:
<apex:page standardController="Account">
    <apex:repeat value="{!$ObjectType.Account.FieldSets.myFieldSetName}" var="field">
        <apex:outputText value="{!field}" rendered="{!IF(field=='fieldAPI__c',false,true)}" />
    </apex:repeat>
</apex:page>

If this resolve your problem, please mark this as solved , so that it gets removed from the unanswered queue which results in helping others who are encountering a similar issue.

Thanks & Regards
Gulshan Raj
LinkedIn 
(https://www.linkedin.com/in/gulshan-raj-a26b0640/)
Twitter (https://twitter.com/gulshan_bittoo)