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
MrBrianMrBrian 

Using {!Selected} for a custom object in a VisualForce Page

Hi! 

I'm trying to create a list button for a custom object the that calls a VisualForce Page, that calls a flow that updated the selected records in a related list. I have had success with this when passing SObjects for standard objects, however, when I try to do the same thing for my custom object Final_Quality_Audit__c, I get an error message on the VF page that seems to indicate that the {!Selected} collection variable does not work here. Here is the screen I get:

User-added image
 
<apex:page standardController="Final_Quality_Audit__c" >
 
    <flow:interview name="Mass_Approve_FQA_Forms" finishLocation="/{!ID}">
        <apex:param name="SObjectFQAForms" value="{!Selected}"/>

    </flow:interview>
</apex:page>

Do I need to "extend" the standard controller for Final_Quality_Audit__c? How do I do that so it supports the {!Selected} functionality?

Thank you!
Brian
swati_sehrawatswati_sehrawat
Hello Brian,

The "{!selected}" variable is not defined and hence you are getting this error, yes you are right and need to "extend" the standard controller for Final_Quality_Audit__c and define the variable to use it on the page using getter and setter.
Lee Gregory 4Lee Gregory 4
You're missing the recordSetVar attribute in the VF page definition.  This is what tells the VF page to use a collection of records for input instead of a single record.  https://developer.salesforce.com/forums/?id=906F0000000AthvIAC