function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

Can we use VF page and still rely on standard page layout to provide general sections/field layout

New to VF and we have a requirement where for specific picklist field  values, we want to be able to display additional fields.  So I have seen some sample VF examples (i.e. the DynamicEditPage ( which shows how this can be done.


But what I need though is to still have different page layouts for the various opportunities record types and so wanted to know if there is a way to still use the settings (i.e. fields and sections created for those oppty page layout) and just somehow add on to the page layout with a VF section that will display additional fields depending on specific picklist field value (in our case, it is also the Opportunity stage picklist).


The example provided only show how we can call on the VF page to edit some basic oppty info and the VF page actually had to define the fields to be displayed and the section name where the fields are being created.  This is not really practical for us since we have 6 opportunity page layouts for each of our oppty record type and then each page layout can easily have over 50 fields and 4/5 sections.  And I don't want to be maintaining the VF page whenever we are just adding a new field or removing a field from a specific opportunity record type.


Can someone let me know if we can in fact use VF page so that it will just call on the default oppty page layout and then have a section where depending on the picklist values, it wll pop up/display additional fields?

And if this is do-able, please point me to the right link/discussion or provide some sample code?


I tried to search through the board but wasn't sure how exactly to find the right discussions on this (assuming someone else had asked this before - and I would think someone else surely must have)


Thanks in advance for your help.


Look up <apex:detail> in the Visualforce documentation:


If I understood your issue correctly, that you provide you what you need.


Good luck!

I might not have been clear. What I wanted is to have different sets of fields show up on a page layout depending on specific the Opportunity Stage values.? But at the same time, I wanted to still rely on using the default page layouts that are already in place for different Opportunity record types and really just wanted to supplement these page layout with the VF ability to render. So what I can do right now is in the Opportunity page, have a custom button that when clicked would pop up a VF page that will display different sets of fields depending on the Opportunity Stage. But what I really like is to just have one Opportunity page (i.e. the default page layout created for each opportunity record type) and then depending on when someone chooses/changes the Stage value, we get new/different sets of fields show up. Is that do-able and if so, can you provide some pseudo code/syntax on how that is done?