+ Start a Discussion
MeerMeer 

Adding Visualforce page in a Detail Page

Hi,

 

Can I add a Visualforce page in a default detail page of custom object? 

Best Answer chosen by Admin (Salesforce Developers) 
bob_buzzardbob_buzzard

The standard aspect of a standard controller doesn't relate to the standard/custom nature of an object, its a controller that is provided by the system that has a bunch of default behaviour, including taking a record id as a parameter and making that record available to the page.  There's a standard controller for every object, both standard and custom.

 

If you don't use a standard controller, you can't override a button/link, its as simple as that.

 

There's nothing to stop you adding your own functionality via an extension controller (extension, as it extends the standard controller).

All Answers

bob_buzzardbob_buzzard

Yes.  In the page layout editor you can choose from the existing visualforce pages that use the standard controller of the object in question.

MeerMeer

Dear Bob,

 

I have a custom Object named as 'Journal'. Now I want to create my own detial page for it. When I click the New button it should go to the default screen where New Journal can be created, but after saving, it should redirect to my Custom Detail Page. Is it possible? For this what I have to do and how?

 

Please help me out.

 

Regards,

 

Meer

bob_buzzardbob_buzzard

You can override the standard view behaviour with your VF page - go to the setup page for the object, scroll down to Standard Buttons and Links, then click the Edit link for View - you can then choose your VF page.

MeerMeer

Dear Bob,

 

I get your point, but in pickup list i am not getting the list of Visualfroce Pages, however I can see the Visualfroce pages when i edit for tab layout. Can u tell me please what I have to do??

 

Thanks a lot.

 

Regards,

Meer 

bob_buzzardbob_buzzard

You will only get the list of visualforce pages that use the standard controller for the custom object in question.

MeerMeer

Sorry for being on your head..

 

Can you please tel me why sould I use standard controller for a custom object? I mean I have my own custom controller which I have called in the Visualforce Page. Secondly, If I use standard control so how can I get the details for my custom object via Standard control? If I am not mistaken I guess each object has its own controller? OR we can use a single controller for Multiple Objects but they should have same ground?

bob_buzzardbob_buzzard

The standard aspect of a standard controller doesn't relate to the standard/custom nature of an object, its a controller that is provided by the system that has a bunch of default behaviour, including taking a record id as a parameter and making that record available to the page.  There's a standard controller for every object, both standard and custom.

 

If you don't use a standard controller, you can't override a button/link, its as simple as that.

 

There's nothing to stop you adding your own functionality via an extension controller (extension, as it extends the standard controller).

This was selected as the best answer
MeerMeer

Thanks a lot for helping me out.. One last question please, whenever I create an object, a standard controller is created by default? Or i dont have the standard controller for it? Let say I have created an object with the name "Journal" so will standard controller will be with the same name? or it doesn't exsist?

 

Beside, thank you very much for being so informtive.. May God bless you..

 

Regards,

Meer

MeerMeer

I got my answers.. standard controller is created by deafult..

 

You are great.

 

Regards,

 

Meer