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
NIKALNIKAL 

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: http://wiki.developerforce.com/index.php/Visualforce_CaseHistoryTimeline

 

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.

 

vfp

SSRS2SSRS2

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">

</apex:page>

 

 -Suresh

 

_Prasu__Prasu_

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) {
this.case = (Case)stdController.getRecord();
}

 

 

 

 

NIKALNIKAL

Hi Suresh,

 

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

 

 

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

 

 

NIKALNIKAL

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

 

VF Page:

 

 

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

 Contoller:

 

public class CaseHistoryCon {

    

 

 

 

SSRS2SSRS2

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) {
}

 

  -Suresh