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
sankumsankum 

facing problem withh fieldset

hi,

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]}"/>   
            </apex:pageBlockSection>
        </apex:pageBlock>
    </apex:form>
</apex:page>

iam did not get the field in vf page

ERROR::Invalid identifier: cr__c

 

 

 

 

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

http://www.salesforce.com/us/developer/docs/pages/Content/pages_compref_repeat.htm
MTBRiderMTBRider

It should look something like this:

 

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

 

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

 

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