I'm creating a custom visual force page that allow users to create a new record for a custom object.

I want understand if in the custom VF page i have the standard functionality of the record type:

-see different field according to the visibility of the page layout

-have different picklist values

I have found this resource:

Displaying Record Types

I have tried creating a custom visual force page and two record types. The record types are linked to different page layout.In one of the two page layouts i have removed some fields. Pressing the New button i can choose which of the two record types i want. They open the same VF page,but i can see on my custom vf Page the same fields.

I would like to be able to show different fields on my custom VF page according to different record types. Is not possible or is there something that i don't know?

Thanks in advantage for any advice.


2 Answers 2


On VisualForce pages you cannot use the 'standard' Page Layout Assignment settings, since that only works with standard page layouts. Also if you use a VisualForce page, there's no use adding or removing fields from the standard page layouts, since you define the page layout in your VisualForce page.

So what you need to do is add a 'rendered=' attribute to your inputfields, where it checks the recordType and based on that renders the inputfield or not.

The different picklist values should already work once you've chose a recordType for your record.

For more help you'd need to post your visualforce page here.

  • since you define the page layout in your VisualForce page. - how? Jun 21, 2013 at 13:44
  • The VisualForce page IS the page layout when you override standard page layouts. Therefore you need to add conditional rendering as Guy says to make the one VisualForce page behave in different ways for each Record Type
    – Doug B
    Jun 21, 2013 at 13:48
  • Yes,the solution is conditional render. I think that the best solution is using also fied set,so you after can change the field in your layout.(looks like a real page layout). Take a look here: forceguru.blogspot.se/2011/02/…. blogforce9.blogspot.in/2013/03/working-with-fieldsets.html
    – Enry
    Jun 22, 2013 at 8:30

Another option is to make multiple Visualforce pages, one for each Recordtype and one "traffic controller" that will be the actual override page, and that just instantly redirects to the proper other page based on Recordtype. If you have two Recordtypes on Object__c, "Customer" and "Other" that go to VF pages customerpage and otherpage respectively, the override page could look something like this, apologies for typos:

<apex:page standardController="Object__c">

<meta http-equiv="REFRESH" content="0;url=/apex/{!IF(($Recordtype.Name == 'Customer'),'customerpage','otherpage')}" /> 


You must log in to answer this question.

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