You need to sign in to do that
Don't have an account?

Render fields on visualforce based on record type
Hi - I have the the following visualforce page. I have been trying to display fields based on the record type selected. I'm using fieldsets. This is based on one fieldset. I have 10 record types and each has separate page layout. How do I make it dynamic so that based on the record type, it display fields?
<apex:page standardController="Auto__c" renderAs="pdf"> <apex:form > <apex:pageBlock title="Details"> <apex:pageblockSection columns="1"> <apex:repeat value="{!$ObjectType.Auto__c.FieldSets.Cars}" var="f"> <apex:outputfield value="{!Auto__c[f]}"> </apex:outputfield> </apex:repeat> </apex:pageblockSection> </apex:pageBlock> </apex:form> </apex:page>

You can accomplish this by creating an extension that defines the record type and field sets that you want to display.