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, 4 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

    Top Zoho Consulting Services in Australia & Dubai

    Blog in Data Migration

    Zoho Consulting Services in Australia & Dubai: Find the Right Partner for Your Business In today’s fast-paced digital world, businesses need powerful tools to stay…

    Zoho Consulting Services in Australia, Zoho Consulting Services in Dubai
    vision Aug 1, 2025
    179  Views
    Sharing Salesforce Visualforce Pages Between Classic & Lightning Experience

    How to Share Salesforce Visualforce Pages Between Classic and Lightning Experience?

    Blog in Lightning, Salesforce customization, Visualforce

    Visualforce Pages should be created correctly such that they behave properly whether they run in Salesforce Classic or Lightning Experience. Detecting and Responding to the…

    Lightning Design System, Lightning Experience, Lightning Experience Themes, Salesforce Classic, Salesforce Classic to Lightning
    Ratnakar Mar 12, 2018
    13,261  Views
    Transform Your Potential Into Profit, Productivity and Performance with Salesforce Lightning

    Transform Your Potential Into Profit, Productivity and Performance with Salesforce Lightning

    Blog in Lightning

    Today’s enterprises cannot be run on yesterday’s systems. Legacy business processes can straitjacket organizations’ growth, and push them into unwarranted situations. To achieve a surge…

    Customer Success, Lightning Component Framework, Salesforce, Salesforce Customization, Salesforce Lightning
    KeyNode Jan 23, 2018
    2,487  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

    © 2026 - 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.