You need to sign in to do that
Don't have an account?
mworld
Replacing Page Layouts with VF Pages
I have seen examples of embedding VF pages in Page Layouts but I have not seen examples of REPLACING Page Layouts with VF pages.
We have a Custom object that has a dozen Record Types that are displayed via a half dozen different page layouts. The users would like to add some additional fields to the layouts that would require creating a VF page to implement. Is it possible to do this?
Can I replace my Page Layouts with VF pages that fulfill the same function but display the custom data users need/want?
We have a Custom object that has a dozen Record Types that are displayed via a half dozen different page layouts. The users would like to add some additional fields to the layouts that would require creating a VF page to implement. Is it possible to do this?
Can I replace my Page Layouts with VF pages that fulfill the same function but display the custom data users need/want?
However, we wanted to create some VF components and access them in standard page layouts so I create the components and then added them to the relevant Page Layouts so that when the page layout is accessed through record types the VF components would display.
The components in question were simple Text as fields but you should be able to create anything VF wise as a component in a page layout, fields, sections, related lists, details etc.
Message Edited by MATTYBME on 01-07-2009 03:31 PM
You can override the view, edit, new, etc. pages for your custom object. Let's say in this case we're talking about overriding the edit page.
If you create a page that uses the standard controller for that custom object (you can use apex extensions for any custom logic you need), you can use it to override the Edit action of the object. Thus any time someone wants to edit a record of that object, they'll be taken to your page instead of the normal edit page.
However as far as page layouts go, you'll have a little less luck. The only component right now that respects page layouts is the apex: detail component, and it's a display component, rather than an edit component. It will respect your page layout based on record type as well. However if you need to add or subtract anything to the detail portion, you will have to construct the detail portion yourself using apex: pageBlock and outputField components. Similarly if you want the edit version of this, you need to construct that using pageBlock and inputField components.
Based on the recordTypeId of the object you can do conditional redirecting or conditional rendering so that the right page or portion of the page shows up for the right recordType, but you'll have to do the work there to recreate your page layouts.
http://ideas.salesforce.com/article/show/10091122/Allow_VisualForce_Detail_Page_to_be_an_edit_form#skin=le
I've also included dependent pick lists as for this to work I'm guessing VF would need to support Record Types and page layouts.
http://ideas.salesforce.com/article/show/10092833/Support_Dependent_Picklists_in_Visualforce#skin=le