Is there any way to show a single vf page as a related list (inside a detail page layout) across multiple / all custom and standard objects like notes and attachments?

I have integrated Salesforce and sharepoint and whenever user clicks upload button from a vf page embedded in a detail page of a record, the data will be updated to sharepoint and the sharepoint url and the current record sf id will be updated in a separate mapping object and the records from that object will be filtered based on current record id and shown as a related list / table inside this vf page. I need to use this vf page across all custom and standard objects so that I can use this as an alternative for notes and attachments and all my data will reside in sharepoint instead of salesforce and it will appear as if it resides in salesforce as records and when the Dcoument names are clicked from the related list, it will open the document from sharepoint.

I have done all these integrations and my only problem now is showing the same vf page across all custom/standard objects.

I know there is a clue :-

  1. Create the vf page with standardcontroller=currentobject name.
  2. Add the vf page to the current object record detail page layout
  3. After adding the page to the page layout, change the attribute standardcontroller in vf page to the next object name, add in that to the next object's page layout and so on.

But, it would really be a pain for doing this for all my 250 objects in the system and even if I do am not sure how I can handle deployment with this and if it will work or not.

And I don't want to create 250 different VF pages (with just different standardcontroller attribute value) either for doing this. Is there any other alternative? Can someone help here?

1 Answer 1



I think you have two options:

1) create a Visualforce Page per Object (automate via batch or shell script and push it via ANT might reduce the workload)

2) given that the sidebar is available for all the pages - create a javascript that injects an Iframe (with src="?id= into the standard layout

here's an example how to get and validate the Id from a standard URL (instance.salesforce.com/)

// regex to test id value
var patt = new RegExp('[a-zA-Z0-9]{15}|[a-zA-Z0-9]{18}');

// get id from standard ui path (instance.salesforce.com/<RECORD_ID>)
var idval = location.pathname.replace(location.hostname,'').split('/')[1];

if (patt.test(idval))
// logic to inject the iframe

For 2 have a look into Forcify's Country Select List, they do the same with picklists http://salesforce.harmkorten.nl/2010/salesforce-country-fields-as-picklists/

  • hi @Seb__Wagner thanks for the response. I dont want to do the 1st one as i dont want to load too many pages in my org and also later if I add some more objects in the future, I need to take care that a vf page is created for that as well. Regarding 2nd approach, I can create a home page component and add an iframe to the pagelayout but will i be able to get the id of the current record id inside the iframe? if so how?
    – Sathya
    Commented May 14, 2013 at 18:28

You must log in to answer this question.

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