+ Start a Discussion
SiriusBlackOpSiriusBlackOp 

Linking to a Visual Force Page Question.

If I wanted to create a visual force page that could be refferenced from any object, what is the best way?

 

If I wanted to create a button to my vf page, then the page must have the object set as it's standardController, right? So, this wouldn't work for any more then one object unless there is some sort of generic controller for sObject or something... Is there?

 

If I wanted users to be able to easily add a custom detail button linking to my vf page on any object's page layout... how would I do that? Is there a generic url that would work for all Orgs or something?

 

Thanks.

Ron HessRon Hess

Right, you must hard code the standard controller of the object so that it can appear in the page layout for that object, no way to build a generic button.

 

unless you build your page, and then add this page address as a URL button. 

Your page would then have to parse the query strings to find out what type of object it was placed on and do the right thing for each object.  

 

 

SiriusBlackOpSiriusBlackOp

Right... I'm thinking the only way is a URL button.  Not the end of the world though.  Thanks for the reply.