Friday, October 11, 2013

Editing Multiple Records at a Time using the RecordSetVar


         You want to edit multiple records at a time ,Don't worry .Salesforce also provided Standard List Controllers(RecordSetVar) along with Standard ,Custom and Extension Controllers.By using RecordSetVar we can achieve it.

       This attribute indicates that the page uses a set-oriented standard controller. The value of the attribute indicates the name of the set of records passed to the page. This record set can be used in expressions to return values for display on the page or to perform actions on the set of records. For example, if your page is using the standard accounts controller, and recordSetVar is set to "accounts". 

Standard list controllers can be used with the following objects:
  • Account
  • Asset
  • Campaign
  • Case
  • Contact
  • Contract
  • Idea
  • Lead
  • Opportunity
  • Order
  • Product2
  • Solution
  • User
  • Custom objects

VisualForce Page:
<apex:page standardController="Opportunity" 
           tabStyle="Opportunity" sidebar="false">
  <apex:form >
    <apex:pageBlock >
      <apex:pageMessages />
      <apex:pageBlockButtons >
        <apex:commandButton value="Save" 
      <apex:pageBlockTable value="{!opportunities}" 
        <apex:column HeaderValue="Oppty Name">
          <apex:inputField value="{!}"/> 
        <apex:column headerValue="Stage">
          <apex:inputField value="{!opp.stageName}"/>
        <apex:column headerValue="Close Date">
          <apex:inputField value="{!opp.closeDate}"/>
    By default the RecordSetVar only displays 20 records at a time.If you want change 
the number of records displayed you can use the extension controller to set the size.

Before changing the AB oppty stage from NeedAnalysis to ProposalPriceQuote

After changing the AB oppty stage from NeedAnalysis to ProposalPriceQuote


No comments:

Post a Comment