We've repeatedly tried to figure out ways to display a Pagelayout and/or FieldSet settings in our custom VF pages without having to rely on the standard controller.

For example to display a fieldset rightnow we use a VF loop:

<apex:repeat value="{!$ObjectType.Project_Task__c.FieldSets.Project_Task_Field_Set}" var="f">
   <apex:outputField value="{!currentTask[f]}" rendered="{!NOT(editMode)}"/>
   <apex:inputField value="{!currentTask[f]}" styleclass="{!f}" required="{!f.Required}" rendered="{!editMode}"/>

The issue being that if we can't query the fields that are currently part of the installed org's preferences, than we can't save them to the record without using the standard controller which abstracts this out.

Also, we can't use an <apex:details /> tag because it automatically redirects to another page when using its standard buttons and we're working inside of a page that we don't want to redirect after saving.

Is there anyway in APEX to discover the users current fieldset for a custom sObject?

1 Answer 1


Have you looked at Schema.FieldSet? It looks like it would do the trick for you. The MerchandiseDetails example at the end of the page uses the Field Set without the standard controller.

  • Looks good, I'll have a look. Commented Aug 19, 2012 at 19:13

You must log in to answer this question.

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