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

Create Custom Button for Visualforce Page

I'm new the the vs development world so trying to make since of it all. I've started teaching myself by following some tutorials provided by SF.


I've successfully created the Case Timeline visualforce page by following these instructions:


My issue is creating a custom button 'Case TImeline' to reference the page. Obviosuly this button would go on the case page.


When I go to create the custom button and reference the vs page, it is not listed under the content selection.




To list under content you must specified 'standardController' in your VF page .If you create custom button for opportunity layout put Opportunity as standardController.



<apex:page standardController="Opportunity">






You will require to make follwoing changes in your VFPAge and controller:


<apex:page standardController="Case" extensions="yourcontrollername">

 Following method will be required in your existing  controller to convert it into extension

public yourcontrollername(ApexPages.StandardController stdController) { = (Case)stdController.getRecord();






Hi Suresh,


On my VF page I have the following which I though refereces my controller:



<apex:page controller="CaseHistoryCon" tabStyle="Case" sidebar="false">




I notice you both mention a 'Standardcontroller' vs what I have of 'controller'


VF Page:



<apex:page controller="CaseHistoryCon" tabStyle="Case" sidebar="false">



public class CaseHistoryCon {






StandardController is necessary to display VF page under Content. so you have to change your page tag as follows and create custom button for Case layout(Setup-Customize-Cases-Buttons and Links).


<apex:page standardController="Case" extensions="CaseHistoryCon" tabStyle="Case" sidebar="false" >


  And add following code stuff to 'CaseHistroyCon' class.


public CaseHistoryCon(ApexPages.StandardSetController controller) {