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
Amita TatarAmita Tatar 

not able to add a vf page in list button

Hi all,

I have a requirement where i want to create a list button and give Visualforce page as a content. But when i do this, i am not able to select vf page as a content while creation of this button. Why is it so? Can anyone help me out here.

Amita Tatar
Hi Amita Tatar,

I think you should add standard controller to your page so you will be able to select page.
can you paste your code so I can help you..
Lokesh KumarLokesh Kumar
Hi Amita Please refer the below code snippet and the article for the same.
<apex:page standardController="Opportunity" recordSetVar="opportunities" tabStyle="Opportunity" extensions="tenPageSizeExt">
    <apex:form >
        <apex:pageBlock  title="Edit Stage and Close Date" mode="edit">
            <apex:pageMessages />
            <apex:pageBlockButtons location="top">
                <apex:commandButton value="Save" action="{!save}"/>
                <apex:commandButton value="Cancel" action="{!cancel}"/>
            <apex:pageBlockTable value="{!selected}" var="opp">
                <apex:column value="{!}"/>
                <apex:column headerValue="Stage">
                    <apex:inputField value="{!opp.stageName}"/>
                <apex:column headerValue="Close Date">
                    <apex:inputField value="{!opp.closeDate}"/>
Article :

Amita TatarAmita Tatar
Actually i have created a custom list  button and in that i want to give Visualforce page as content source
Hi Amita,
Follow this image
just redirect to your visual force page and you can also append record Id to your vf page
Amita TatarAmita Tatar
Hi Prithviraj,

I have done the following thing:
window.location.href = "/apex/InvoicePrint?id={!Invoice__c.Id}"

But it says invalid id
var c = new sforce.SObject("InvoiceObject__c"); ="{!InvoiceObject__c.Id }";
var url='yourpage/{!}';
window.location.href = url;
you must include connection.js and apex.js