Toggle Side Panel

  • Blogs
  • 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
  • Contact Us
  • Discussions
More options
    Sign in Sign up
    • Blogs
    • 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
    • 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 8 years, 1 month 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>

    • [adinserter block='9']
    • 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

    Popular Salesforce Blogs

    B2B eCommerce

    Salesforce Commerce Cloud - The Gateway to B2B eCommerce Success

    Blog in Salesforce Cloud Platform

    The B2B eCommerce industry is constantly changing. These changes are more profound and permanent than any that occurred in the past, given the recent developments…

    Artificial Intelligence, B2B, B2B Commerce Environments, B2B Commerce Firms, B2B Consumers and Technology
    Innovadel Aug 18, 2022
    2,237  Views
    A Detailed Guide to Salesforce RPA Integration in 2023

    A Detailed Guide to Salesforce RPA Integration in 2023

    Blog in Salesforce

    Salesforce is one of the most popular CRM software in the world. There are a lot of benefits to using Salesforce, but one of the…

    Apex Triggers, Bulk Triggers, Creating Triggers, Insurance, Insurance Agents
    SP Jan 30, 2023
    2,248  Views
    First Step to as a Salesforce Developer

    First Step to as a Salesforce Developer

    Blog in Salesforce customization, Salesforce Implementation, Salesforce Stories

    So the things would get exciting now. I'll first accomplish the Customization part and then gradually move on to the Programming aspect. You have an…

    Content Management, CRM, Salesforce, Salesforce Customization, Salesforce Developers
    Anup May 12, 2016
    5,950  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®.

    We use cookies to enhance your browsing experience. Please see our privacy policy if you'd like more information on our use of cookies.