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
nduchnduch 

Button that opens a Visualforce page cannot be created

HI,

I have created a Visualforce page and a new button that should open this Visualforce page.

However, when creating the button I chose Content Source= Visualforce page, but Content field is blank and I cannot enter text into it. Therefore I cannot save the button.

 

It looks like a bug. Or am I doing something wrong? See attached screenshot.

 

 

Best Answer chosen by Admin (Salesforce Developers) 
kiranmutturukiranmutturu

nope standard controller represents on which object that u want to override the new button...

 

so it should be some thing like this if it is on account object

 

<apex:page standardcontroller="account" extensions="SendEmailPageController"/>

 

and when you save this page u got an alert stating that ur class must contains one parameterized standard controller aruguement....click on that alert it will automatically created the required code in the back end...

All Answers

Navatar_DbSupNavatar_DbSup

Hi,

 

You need to add standardcontroller attribute as your object in your VF page For Example standardController="UserConnection__c" then it will display in your content source .

 

Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved. 

nduchnduch

Hi Navatar,

this Visualforce page is using my own controller that handles the app logic:

 

<apex:page controller="SendEmailPageController">

 

Can a standard controller reference to my own controller?

 

<apex:page standardController="SendEmailPageController"> ????

 

 

 

 

 

kiranmutturukiranmutturu

nope standard controller represents on which object that u want to override the new button...

 

so it should be some thing like this if it is on account object

 

<apex:page standardcontroller="account" extensions="SendEmailPageController"/>

 

and when you save this page u got an alert stating that ur class must contains one parameterized standard controller aruguement....click on that alert it will automatically created the required code in the back end...

This was selected as the best answer
nduchnduch

Many thanks, Kiran!

 

Your advice worked like charm:

 

<apex:page standardController="Contact" extensions="SendEmailPageController"

 

I can now reference the button to the Visualforce page.

nduchnduch

Hi,

I have successfully created a button that opens a Visualforce page.

 

But why is the Visualforce page displayed to the user together with the code editor???

aballardaballard

Sounds like you have developer mode turned on... the editor displays only for users with that setting on (and a profile that allows them to edit pages definitions....)