Toggle Side Panel

  • Home
  • Articles
    • All Articles
    • Blogs
    • Videos
    • Infographics
  • Consultants
    • Salesforce Product Expertise
      • Top Salesforce ConsultantsTop Salesforce Consultants
      • Marketing Cloud ConsultantsMarketing Cloud Consultants
      • Service Cloud ConsultantsService Cloud Consultants
      • Experience Cloud ConsultantsExperience Cloud Consultants
      • Analytics Cloud ConsultantsAnalytics Cloud Consultants
    • Salesforce Industry Expertise
      • Non-Profit Cloud ConsultantsNon-Profit Cloud Consultants
      • Financial Service Cloud ConsultantsFinancial Service Cloud Consultants
      • Health Cloud ConsultantsHealth Cloud Consultants
      • Commerce Cloud ConsultantsCommerce Cloud Consultants
      • Manufacturing Cloud ConsultantsManufacturing Cloud Consultants
    • Salesforce Experts by Location
      • USATop Salesforce Consultants in USA
      • IndiaTop Salesforce Consultants in India
      • AustraliaTop Salesforce Consultants in Australia
      • United KingdomTop Salesforce Consultants in UK
      • CanadaTop Salesforce Consultants in Canada
  • Webinars
  • Marketplace
  • Advertise With Us
  • Contact Us
  • Discussions
More options
    Sign in Sign up
    • Home
    • Articles
      • All Articles
      • Blogs
      • Videos
      • Infographics
    • Consultants
      • Salesforce Product Expertise
        • Top Salesforce ConsultantsTop Salesforce Consultants
        • Marketing Cloud ConsultantsMarketing Cloud Consultants
        • Service Cloud ConsultantsService Cloud Consultants
        • Experience Cloud ConsultantsExperience Cloud Consultants
        • Analytics Cloud ConsultantsAnalytics Cloud Consultants
      • Salesforce Industry Expertise
        • Non-Profit Cloud ConsultantsNon-Profit Cloud Consultants
        • Financial Service Cloud ConsultantsFinancial Service Cloud Consultants
        • Health Cloud ConsultantsHealth Cloud Consultants
        • Commerce Cloud ConsultantsCommerce Cloud Consultants
        • Manufacturing Cloud ConsultantsManufacturing Cloud Consultants
      • Salesforce Experts by Location
        • USATop Salesforce Consultants in USA
        • IndiaTop Salesforce Consultants in India
        • AustraliaTop Salesforce Consultants in Australia
        • United KingdomTop Salesforce Consultants in UK
        • CanadaTop Salesforce Consultants in Canada
    • Webinars
    • Marketplace
    • Advertise With Us
    • Contact Us
    • Discussions
    Close search

    Activity › Forums › Salesforce® Discussions › How to show my account list on apex page at the time when we preview the page in Salesforce?

    Tagged: Account List, Apex Page, Salesforce Apex, Salesforce Customization

    • Salesforce® Discussions

      How to show my account list on apex page at the time when we preview the page in Salesforce?

      Posted by shariq on August 17, 2017 at 9:37 AM

      I want to show my account list at the time when the page loads(At the starting).

      shariq replied 7 years, 2 months ago 3 Members · 4 Replies
      • Account List
      • Apex Page
      • Salesforce Apex
      • Salesforce Customization
    • 4 Replies
    • Neha

      Member
      August 17, 2017 at 9:47 AM

      Hi Shariq,

      You can use recordSetVar to view the list and create a variable "var" in <apex:repeat> tag to acess the records. May this example helps you:

      <apex:page standardController="Account" recordSetVar="Accounts" >
      <apex:pageblock>
      <apex:repeat var="a" value="{!Accounts}" rendered="true" id="account_list">
      <li>
      <apex:outputLink value="/{!a.ID}" >
      <apex:outputText value="{!a.Name}"/>
      </apex:outputLink>
      </li>
      </apex:repeat>
      </apex:pageblock>
      </apex:page>

    • shariq

      Member
      August 17, 2017 at 11:03 AM

      Hi Neha,

      In your apex controller you have taken list in a constructor, I am taking list in a method, then how to show my list when the page loads.

    • Parul

      Member
      September 15, 2018 at 3:06 PM

      You can use recordSetVar and apex:repeat to view the list and variable “var” in <apex:repeat> tag to acess the records.

       

      <apex:repeat value="{!accs}" var="acc">
      <tr>
      <td><apex:outputText value="{!acc.Name}"/></td>
      <apex:repeat value="{!acc.Contacts}" var="cont">
      <td><apex:outputText value="{!cont.Name}"/></td>
      </apex:repeat>
      </tr>
      </apex:repeat>

       

      Thanks

    • shariq

      Member
      September 16, 2018 at 10:10 AM

      Hi Parul,

      Correct answer which I got online -

      public static List<Account> getListAcc(){

      List<Account >accList = new List<Account >();

      //Logic

      return accList;

      }

      Then use ListAcc on VF page.

      Thanks.

    Log In to reply.

    • Public
    • All Members
    • My Connections
    • Only Me
    • Public
    • All Members
    • My Connections
    • Only Me
    • Public
    • All Members
    • My Connections
    • Only Me

    application solution

    Popular Salesforce Blogs

    Salesforce Maps

    Introduction to Salesforce Maps

    Blog in Salesforce Products

    Introduction Salesforce maps is an add-on paid product of Salesforce. It is a geo-location intelligence app that helps the business to optimize sales process territory…

    Base Object, Business, Business Leaders, Business Rules, Customers
    Arun Nov 17, 2021
    5,534  Views

    No Code Clearbit and Salesforce Integration

    Blog in Salesforce integration

    Clearbit is a consumer contact marketing data engine. It assists businesses in expanding by delivering solutions that enable them to better understand their clients, discover…

    APIs, Applications, Business Operations, Clearbit, Clearbit and Salesforce Integration
    Apphienz Apr 7, 2022
    2,108  Views

    Salesforce CPQ Implementation Guide: Tips and Challenges

    Blog in Salesforce Implementation

    Salesforce has been one of the reputed CRMs offering valuable data and assisting companies in handling their business better. Salesforce is now focusing more on…

    Automated Sales Quoting, Automation, Automation System, Billing Growth, Business
    Ksolves May 18, 2022
    4,289  Views
    Footer Forcetalks logo

    support@forcetalks.com

    • twitterx

    Quick Links

    Advertise with Us

    Salesforce® Articles

    Dreamforce 2023

    Top Salesforce® Bloggers 2023

    Top Salesforce Consultants

    Get Listed

    Company

    Contact Us

    About Us

    Privacy Policy

    Terms & Conditions

    InsightHub

    Salesforce Blogs

    Salesforce Videos

    Salesforce Groups

    Salesforce Jobs

    © 2025 - Forcetalks ● All Rights Reserved

    Salesforce® is a trademark of Salesforce® Inc. No claim is made to the exclusive right to use “Salesforce”. Any services offered within the Forcetalks website/app are not sponsored or endorsed by Salesforce®.

    Try AuditMyCRM - It is a Salesforce CRM Audit tool which comprehensively scans your Salesforce org and gives you the list of errors or warnings you need to take care of.
    We use cookies to enhance your browsing experience. Please see our privacy policy if you'd like more information on our use of cookies.