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 7 years, 11 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>

    • [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

    Opportunity Line Items

    Opportunity Line Items in Salesforce - Learn Here

    Blog in Salesforce Apex

    What are Opportunity Line Items?  The Products connected to an Opportunity are called OpportunityLineItem.  There are many different things that a business might sell. These…

    Business, Customers, Identify Development, Opportunity Line Items, Opportunity Product Lines
    Ashish Oct 25, 2022
    3,082  Views

    Specific Differences In Salesforce

    Blog in Others

    WhoId Vs WhatId WhoId WhatId WhoId represents the person type things. WhatId represents object type things. LeadId and ContactId are categorized under the whoId. WhatId…

    Custom Controller, Custom Objects, Custom Settings in Salesforce, Picklist, Salesforce Differences
    Archit Dec 18, 2018
    5,708  Views

    Unlocking the Power of Salesforce Outsourcing

    Blog in Salesforce Consultant

    In the ever-evolving world of business, organizations are constantly on the lookout for innovative approaches to streamline operations and fuel growth. One increasingly popular strategy…

    Best Practices, Business Success, Collaboration, Collaboration Tools, Comprehensive Knowledge Transfer Process
    Kizzy Consulting Aug 25, 2023
    1,239  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.