0

I have the following inline visualforce page which gives me an internal server error.

<apex:page standardcontroller="Agreement__c">
    <apex:repeat value="{!$ObjectType.Agreement__c.FieldSets.MyFieldset}” var="f"> 
        <apex:outputText value="{!Agreement__c[f.fieldPath]}" />
    </apex:repeat>
</apex:page>

This fieldset is pulling fields from related objects and if I switch to one that is only pulling fields from the object itself it works correctly.

Is this a known limitation around fieldsets and dynamic binding?

NEW: After some additional testing this appears to only occur when I pull in related fields from the agreement object itself. e.g. I have a lookup to agreement__c on agreement__c and the page only throws internal server error when using that lookup but pulling in from other related objects works fine.

Error ID: 1936706758-1056 (1347345803)

2
  • var="f" in line 2 and [f.fieldPath] on line 3 have the same value, which is the API name for the field on this object. It sounds like your request is specifically about rendering fields defined in the fieldset that are acquired from related records. Correct? (f is a Schema.FieldSetMember and in this case it's .toString() method returns the field name)
    – Mark Pond
    Commented Aug 13, 2015 at 1:15
  • 1
    @MarkPond, yes, I got the same results with both. I did some more testing and it appears to only occur when using a lookup to the same object. Commented Aug 13, 2015 at 13:22

2 Answers 2

0

I used your code and recreated it using the Account object along with a new fieldset called MyFieldset. It worked rendering fields on the Accountrecord as well as the User record via lookup reference.

Your code looks to work perfectly as written.

<apex:page standardController="Account">

    <apex:repeat value="{!$ObjectType.Account.FieldSets.MyFieldset}" var="f"> 
        <apex:outputText value="{!Account[f.fieldPath]}" />
    </apex:repeat> 

</apex:page>

Which rendered YesGenePointMark Pond; the three fields in my set were Active, Name and Owner > Name.

You'll have to elaborate on your question to get much more assistance.

2
  • Can you try adding some fields from the parent account to the fieldset. I was able to reproduce this error on accounts like that. Commented Aug 13, 2015 at 13:31
  • @GregGrinberg yup, this is a problem that shows up when using a self-reference to the same object type in a VF context. Just rendering <apex:outputText value="{!f}" /> does show the correct path to the field but trying to bind to that field on the object fails with the internal server error. I'd open a case about it and include the gack id that you appended to your question.
    – Mark Pond
    Commented Aug 13, 2015 at 15:52
-1

I got a similar crash. I was on API 24, changed to 41 and it worked

2
  • this would be better suited as a comment rather than an answer unles you provide a solid explanation on why this should work.
    – glls
    Commented Apr 30, 2018 at 17:02
  • This answer seems legitimate. As versions change, bugs get fixed. It seems like this particular question was one such case. Voting not to delete.
    – Adrian Larson
    Commented May 1, 2018 at 0:46

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .