+ Start a Discussion
Simon234Simon234 

Custom Button that links to the Visualforce Page

I need to create a Button for the Page Layout that links to the Visualforce Page (another page). It's for custom object. How can I do that? Can I use "Buttons, Links, and Actions" to open VF Page? Or I need to create another VF Page?
Best Answer chosen by Simon234
Raj VakatiRaj Vakati
You can create a on click javascripy button that will redirect to the another vf page 
 
{!REQUIRESCRIPT('/soap/ajax/26.0/connection.js')} 
var accReq = "{!Account.Name}";
if(accReq != '') {
window.location="/apex/VisualforceName?id={!Account.Id}";
}
else {
alert('Name is mandatory');
window.location.reload(); 
}