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
Edwin KEdwin K 

Visualforce Page shown in edit mode on Page layout

Hi all,

 

I have a question is it possible to show visualforce page on the page layout when I hit edit button ? My case is I want to show the visualforce page and standar page layout at the same time on page layout in edit mode. Is is possible to do that? Or maybe there is other suggestions for may case would be great.

 

Thanks

 

Regards,

 

Edwin

sebcossebcos

Hi Edwin,

I am not entirely sure what you want to achieve but this is what Visualforce allows you to do from Visualforce dev guide (

http://www.salesforce.com/us/developer/docs/pages/index_Left.htm#StartTopic=Content/pages_intro_what_is_it.htm?SearchType=Stem) :

Developers can use Visualforce pages to:

  • Override standard buttons, such as the New button for accounts, or the Save button for contacts
  • Override tab overview pages, such as the Accounts tab home page
  • Define custom tabs
  • Embed components in detail page layouts
  • Create dashboard components or custom help pages
It sounds like you want to embed a visualforce component/page inside a page layout. In general, this is only possible in view mode but you could build a page which uses the visualforce detail tag which renders the page layout and add your visualforce markup to it for edit mode something like this:
<apex:page standardController="Account">
     	
     <apex:detail  showChatter="true" relatedList="false"/>
     <!-- your markup here-->
     <apex:relatedList list="Contacts"/>
     <apex:relatedList list="Cases"/>
     <apex:relatedList list="Opportunities"/>

</apex:page>

The relatedList tag allows you to render the related lists at the bottom of the page.

This is one of the possibilities, you could alternatively create a tabbed page which shows the detail page and then in the tab the sections that you want to edit as shown here:

http://www.salesforce.com/us/developer/docs/pages/index_Left.htm#StartTopic=Content/pages_quick_start_tabs.htm?SearchType=Stem . You need to change a bit the example to make the tabs part editable.

Lastly, I would consider also the new inline Edit  feature in Visualforce which allows to have both view and edit on the same page at the same time:

http://developer.force.com/releases/release/Spring11/Visualforce+Inline+Editing

http://www.salesforce.com/us/developer/docs/pages/index_Left.htm?use%20of%20visualforce%20page

 

Please keep in mind that you need to override the standard edit button for the object and that the original edit functionality  will be hidden in general for all users.

 
Rajesh U.Rajesh U.

I am not sure original poster got his answer from this. I have similar issue. I am rendering object in my own area, say I create two column table. on column 1 I display object link, when user user clicks on the column1, I display object detail in column2, with all standard buttons (i.e. using <apex:detail>). Now when I click on edit button, it brings me out from my table based detail page into vf default standrd edit page for the object. I would like to keep user in the same table based view in column2 of my table. is this possible? how?

Brian HopkinsBrian Hopkins
Hi, it is 3 years later, and there is still no solution for this unfortunately.  When you add a visualforce page to a page layout, it does not appear on the 'Edit' page for that record.  I ran into this because I was trying to use input fields in a visualforce page.  But it did not work.  The fields were editable on the 'view' page, and not visible at all on the 'edit' page.

I think adding visualforce pages as components to a page layout is intended to suppliment the 'detail' on the page, and not intended for editing.
Roger WickiRoger Wicki
I have the very same problem:
When I create a new record of my custom object or edit an existing one, I need the edit page to show the user an information. The information is not related to a single field, but is a general information about what and how to enter data so I can't simply put it in an info bubble (which offers not enough space & formatting anyway).
So I want this VF page appear in the edit mode of the object to inform the user.
GaryAGaryA
Update: with the introduction of lightining embedded VF page are now displayed in lightining standard edit pages.
AnupPrakash_AlgoworksAnupPrakash_Algoworks
Hi this request could now be taken care of from now onwards all thanks to #Salesforce #Summer16
for your reference you can visit: https://success.salesforce.com/ideaView?id=08730000000Br8CAAS
Kyle Walsh 27Kyle Walsh 27
Unfortunately this truly wasn't delivered. You can do this in Lightning ONLY. This is needed in Salesforce Classic as well. This is not the first time Salesforce has said it has delivered on a highly requested idea only to have it done half-heartedly and not please the people who are asking for it.
Bob NagyBob Nagy
There also appears to be no way to configure the embeded visualforce component to NOT display on the New/Edit page.  If the component was designed assuming it was associated with an existing record (which was the case when used on on the detail page) they now break when displayed on a New page.  Yes, you can chak for the object Id and not display the contents if the Id is null (new mode) but the label still appears and the sapce designated for the component is still reserved on the page leaving a big white space. 

If you want to not display the contents of the component in New OR Edit mode you are really in trouble as there appears to be no method for determinig the current mode.  An object id is available in both viw and edit and there is no method on StandardController you can call differentiate. 
Charles ThompsonCharles Thompson
How about this as a workaround for Classic VF pages:
1) Add the VF page as a component on the Page Layout.  This displays your "view mode" page in the object's detail page view mode.
2) Have a button on the VP page that changes the embedded page to a different ("edit mode") VF page.
For me, the problem is writing the code to swap my VF page, rendered as a component on an object detail page, to a different one (and back again).  Has anyone encountered this?

The use case for this is that a standard Related List can only have 10 columns.  My related list needs 13.  I've written an edit mode VF page that replaces the related list with a pageBlockTable, displaying and manipulating the related table's records using inputFields.  I also have a view mode version that simply displays the related list values and has a button to switch to Edit mode.  Just need to get that button to work.
starlightstarlight
Hi Charles,
my need is something like you discussed 
"The use case for this is that a standard Related List can only have 10 columns.  My related list needs 13.  I've written an edit mode VF page that replaces the related list with a pageBlockTable, displaying and manipulating the related table's records using inputFields.  I also have a view mode version that simply displays the related list values and has a button to switch to Edit mode.  Just need to get that button to work."

I need tochange the number of existing related list column to 13 .
i know we can use "<apex:relatedList list="Contacts" pageSize="20" />"
but i dont know how to open th VF page for the existing related list and modify it.??
any idea how to proceed ??
Thanks in advance..
dipti