+ Start a Discussion
soasoa 

How to call a visualforce page from a button..

Hi,
I have created a visualforce page as the following link.
 
 
The page is created . You can view the page at :
 
 
I need to call this visual force page on click of a  custom button as I used to do for Apex class.
 
How do I do it..
 
Please help..
 
regards,
Diti
 
 
RickyGRickyG
Diti -

Create a button and assign it as a URL value.  Give the relative URL of the Visualforce page (/apex/name . . .) as the value and you should be good to go.

Hope this helps.
VisualForceVisualForce

Custom button property

 

LabelPDFObject NameAccount
NamePDF  
BehaviorDisplay in new windowDisplay TypeDetail Page Button
Content SourceVisualforce Page  
Height (in pixels)600Visualforce Pageyour vf name
Width (in pixels)  Show Address BarNot Checked
Window PositionNo PreferenceShow ScrollbarsChecked
ResizeableCheckedShow ToolbarsNot Checked
  Show Menu BarNot Checked
Description
  Show Status Bar

Not Checked

 
 
or
 
onclick javscript code for ur custom button is
 
window.location.href = '/apex/VFname';
Volker_factory42Volker_factory42

We had similar problems. Our solution was to create a commandlink which looks like a button:

 

 

<apex:commandLink value="Click Me" action="{!CallMethod}" target="_blank" styleClass="btn" style="padding:2px 5px 2px 5px; text-decoration:none;" >