Tell me more ×
Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It's 100% free, no registration required.

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}"/>
</apex:repeat>

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?

share|improve this question

1 Answer

up vote 2 down vote accepted

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.

share|improve this answer
Looks good, I'll have a look. – jordan.baucke Aug 19 '12 at 19:13

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.