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
duyplduypl 

How to customize View Detail / Edit pages of Account, Contact, etc.

Hi,

 

I'm working on a SharePoint application. Now there is a new feature that requires the integration between SharePoint and Saleforce. Here is the inital idea: when a Saleforce user edits a Contract (or any kind of sObject) in Saleforce site, I'd like to have a new custom textbox field and a button next to it. Clicking on button results opening a new window in browser that lists documents related to the Saleforce user, and in new window they can select a document, then the id of selected document is saved back in the custom field of Contract object being edited.

 

I learnt that Visualforce can create page and custom component but it doesn't seem to match with what I need. I didn't see the help on how to to inject custom component to standard page layout :(

 

The problem I'm having is that I don't know how to implement the custom field with additional logic like that in order to insert to these View Detail and Edit layouts. Can you show me any hint or related guideline ?

 

Thanks,

Duy

mast0rmast0r

For that you need to create a VF-page with a standart controller=account/contact etc and apex:detail panel and your custom field with a button. Then you have to override your standard object page layout with you VF-page so the user opens an account see your custom VF-page. You have to do this because you can not "edit" a standard layout page like your visualforce page.

duyplduypl

Thank mast0r, I'll try this way :)

duyplduypl

I found another way : we can add a VF page to page layout by using the standard controller on VF page. By this way we can avoid to override the standard page layout. However, I have another problem : the content of Visualforce page disappears when user edits an Account and it shows up in Detail view. 

 

Do you have any idea why it is ?

 

Edit : found the answer :( http://boards.developerforce.com/t5/Visualforce-Development/Using-VisualForce-page-in-New-Edit-record-layout/m-p/185166/highlight/true#M24582

mast0rmast0r

It is not the better way to do this, because your VF page will be injected as an iFrame, so youdo not have access from the iFrame to parent page (standard layout page). You can try it anyways.

duyplduypl

I did it although it isn't quite correct to original requirement. I created a VF page with extended controller and then embbed that page in a Section in page layout. That's somehow looks good to me now. :)