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

facing problem withh fieldset


iam new to use field set in visualforce page

i created a one field set to retrive to vf page iam getting the error!




<apex:page controller="fieldset1">
    <apex:form >
        <apex:pageBlock title="Field Set List">
            <apex:pageBlockSection >
            <apex:repeat value="{!$ObjectType.cr__c.Fieldsets.Myfieldset}"/>
             <apex:inputField value="{!cr__c[f]}"/>   

iam did not get the field in vf page

ERROR::Invalid identifier: cr__c





You aren't using your apex:repeat correctly. There is no value called 'cr__c':

It should look something like this:


    <apex:repeat value="{!$ObjectType.[Object Name].FieldSets.[FieldSet Name]}" var="f">
       <apex:inputField value="{!showFieldSet[f]}"/>


 So if cr__c is your object and MyFieldset is the name of the field set you created in cr__c:


    <apex:repeat value="{!$ObjectType.cr__c.FieldSets.Myfieldset}" var="f">
       <apex:inputField value="{!showFieldSet[f]}"/>