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
steeeeveeeeeesteeeeveeeeee 

Adding a button or link in the middle of Standard detail page

Hey guys I'd like to know if its possible to add a button or link to another visualforce page on a page, however I would like to do it in the middle of a page right above another text field in the layout.  Is this possible?  As far as I know custom buttons only go at the top of the page and right above the related lists.

Best Answer chosen by Admin (Salesforce Developers) 
Platy ITPlaty IT

Yes, you can use the Hyperlink() function in the formula and have it generate the URL to that Visualforce page.

All Answers

Hengky IlawanHengky Ilawan

You can add a visualforce page that contains a custom button to your standard page layout.

Is that what you are trying to achieve?

 

-Hengky-

Platy ITPlaty IT

While Visualforce provides you with the pageBlockButton tag to mimic the placement of buttons at the top and/or bottom of pages like in standard Salesforce page layouts, you're also free to create a commandButton anywhere on your Visualforce page- either inside a Visuaforce structure like pageBlockSectionItem or even within standard html (i.e."<div><apex:commandButton action="{!SomeAction}"></div>")

steeeeveeeeeesteeeeveeeeee

Thanks for the reply, The problem is i'm not working on Custom Visualforce page at the moment.  My objective was to see if it was possible to add a button to a Standard detail page.  For example Opportunity.  I wanted to place the button next to where I could place my fields.  

 

I can do this for a custom page so are my only options limited to embedding a Visualforce page inside the standard page and then doing what I need to?

Platy ITPlaty IT

Ah, I had assumed you were refering to a Visualforce page.  For standard pages, you can only add links (either using the Custom Links section or by creating a formula field that generates a link) to the middle of the page.  So yes, the only workaround for that would be a Visualforce page that uses the object you're working on as the StandardController of the page and then dropping that VF into the page layout.  Just note that those embedded VF pages are only available when a record is being viewed, not when the user is creating or editing a record.

steeeeveeeeeesteeeeveeeeee

To elaborate on using the formula field as a link.  Is it possible then to link to another visualforce page?  Thanks

Platy ITPlaty IT

Yes, you can use the Hyperlink() function in the formula and have it generate the URL to that Visualforce page.

This was selected as the best answer