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
Gil HechtGil Hecht 

{!selected} Not working?

I am trying to create a custom list button that lets me edit certian fields from multiple leads at once. It does not recognize the records I select, however. I think it's a problem with {!selected} becuase when I subsitute that for {!leads} all leads appear on the page just fine. Any ideas? Thanks!

<apex:page standardController="Lead" recordSetVar="leads" tabStyle="Lead" extensions="tenPageSizeExt">
    <apex:form >
        <apex:pageBlock title="Edit Last Dialed and Calls Made" mode="edit">
            <apex:pageMessages />
            <apex:pageBlockButtons location="top">
                <apex:commandButton value="Save" action="{!save}"/>
                <apex:commandButton value="Cancel" action="{!cancel}"/>
            </apex:pageBlockButtons>
            <apex:pageBlockTable value="{!selected}" var="leadselect">
               <apex:column headerValue="Lead Name">
                <apex:inputField value="{!leadselect.name}"/> </apex:column>
                <apex:column headerValue="Last Dialed">
                    <apex:inputField value="{!leadselect.Last_Dial__c}"/>
                </apex:column>
                <apex:column headerValue="Number of Dials">
                    <apex:inputField value="{!leadselect.Calls_Made__c}"/>
                </apex:column>
            </apex:pageBlockTable>      
        </apex:pageBlock>
    </apex:form>
    </apex:page>

 
Best Answer chosen by Gil Hecht
Amit Chaudhary 8Amit Chaudhary 8
HI Gill Hecht,

Step1 :- To use above code you need to create one "List Button" like below :-
User-added image


Step 2:- Then Add the button on List View:-
Setup :- Lead:- Seach layout -> Leads List View
Like below screen shot
User-added image

Step 3:- Then click on Leads List View and add New button on page layout like below :-


User-added image

Step 4:- Then Go to list view and seletc some record and the n click on button like below screen shot :- 
User-added image

Step 5 :- Finaly the result 
User-added image

Please mark this as solution if this will help your.

Thanks
Amit Chaudhary
amit.salesforce21@gmail.com

All Answers

surasura
colud you share the extension code
Gil HechtGil Hecht

Here's the extension code!

public class tenPageSizeExt {

    public tenPageSizeExt(ApexPages.StandardSetController controller) {
        controller.setPageSize(10);
    }
}
Amit Chaudhary 8Amit Chaudhary 8
HI Gill Hecht,

Step1 :- To use above code you need to create one "List Button" like below :-
User-added image


Step 2:- Then Add the button on List View:-
Setup :- Lead:- Seach layout -> Leads List View
Like below screen shot
User-added image

Step 3:- Then click on Leads List View and add New button on page layout like below :-


User-added image

Step 4:- Then Go to list view and seletc some record and the n click on button like below screen shot :- 
User-added image

Step 5 :- Finaly the result 
User-added image

Please mark this as solution if this will help your.

Thanks
Amit Chaudhary
amit.salesforce21@gmail.com
This was selected as the best answer
Gil HechtGil Hecht
thanks I forgot to click display checkboxes when creating my button!