+ Start a Discussion
Sarim AlaviSarim Alavi 

Error: Expression of type Text cannot be subscripted.

hi whenever i am using field set in my visualforce page i am getting ErrorError: Expression of type Text cannot be subscripted.

this is the code

 

 

 

<apex:repeat value="{!$ObjectType.Hotel_Reservation__c.FieldSets.ReservationCheck}" var="f">
                <apex:outputField value="{!selectedContact[f]}"/>
            </apex:repeat>

aballardaballard

Sounds like selectedContact is not correct -- a string instead of a Hotel_Reserveration__c which is what it would need to be for this to be valid.