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 return and show the list of all Account Names using a Custom Controller in Salesforce?

    Tagged: Account List, Account List in Salesforce, Account Name, Custom Controller, Customization, Salesforce Customization

    • Salesforce® Discussions

      How to return and show the list of all Account Names using a Custom Controller in Salesforce?

      Posted by Raghav Chaturvedi on April 25, 2018 at 12:33 PM

      I have a button accountsName, I want when I click on the button, the list of all account name will return and show all account name using a custom controller

      Raghav Chaturvedi replied 7 years, 11 months ago 2 Members · 2 Replies
      • Account List
      • Account List in Salesforce
      • Account Name
      • Custom Controller
      • Customization
      • Salesforce Customization
    • 2 Replies
    • Aman

      Member
      April 25, 2018 at 5:05 PM

      Hi Raghav,

      Below is the code for apex controller :

      public class AccountNameDemo {
      Public List<Account> listOfAccounts{get;set;}
      public boolean showAccount{get;set;}

      public AccountNameDemo(){
      listOfAccounts = new List<Account>();
      showAccount = false;
      }

      public void AccountList(){
      listOfAccounts = [select id,name from Account limit 50000];
      showAccount = true;
      }

      }

      here is the code for visualforce page :

      <apex:page controller="AccountNameDemo">
      <apex:form>
      <apex:commandButton action="{!AccountList}" value="AccountsName" id="theButton"/>
      <apex:repeat value="{!listofAccounts}" var="acc" rendered="{!showAccount}">
      <apex:outputText value="{!acc.name}"></apex:outputText>
      <br/>
      </apex:repeat>
      </apex:form>

      </apex:page>

       

      below is the screen shot of output :

      Salesforce   Developer Edition

    • Raghav Chaturvedi

      Member
      April 26, 2018 at 11:23 AM

      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 Agentforce for Nonprofits

    Blog in Salesforce Products

    Nonprofits are constantly faced with the challenge of meeting growing demands with limited resources and inefficient processes. When your constituents need help or information, you…

    Agentforce, Ai, AI Tool, Analyze, Automate
    DB Nov 11, 2025
    96  Views

    Top Salesforce Winter ’22 Release - Features and Highlights

    Blog in Salesforce

    Salesforce never fails to amaze its users and it did it once again with some new and exciting features it brought with Salesforce Winter ‘22…

    Business Goals, Collaborative Forecasting, Dashboard, Development Process, Dynamic Guage Charts
    360 Degree Jan 17, 2022
    2,446  Views
    7 Signs Your Company Needs a Salesforce Consulting Partner

    7 Signs Your Company Needs a Salesforce Consulting Partner

    Blog in Salesforce Consultant

    1. Struggling with Salesforce Adoption One of the most common challenges businesses face is low adoption rates of Salesforce among their teams. Despite its powerful…

    api-integration, Business Objectives, Change Management, Customer Engagement, Customer Satisfaction
    Infodriven Jun 4, 2024
    553  Views

    Popular Salesforce Videos

    How to Reference Custom Metadata Types to Optimize Salesforce Account Records Using Salesforce Flow

    How to Reference Custom Metadata Types to Optimize Salesforce Account Records Using Salesforce Flow

    Video in Salesforce Development

    Watch this video to learn how to reference custom metadata types to optimize Salesforce Account Records Using Salesforce Flow Salesforce Account Region Allocation using custom…

    Salesforce Training, Salesforce Tutorial, salesforce, Salesforce Flow, Salesforce Video
    Prafull Jun 8, 2021
    1,633  Views
    Launch of Virtual Sales Tools | Salesforce 360: New Features

    Launch of Virtual Sales Tools | Salesforce 360: New Features

    Video in Salesforce Products, Sales

    Salesforce has announced new Sales Cloud and supporting features to make virtual sales experiences more engaging and productive. In a nutshell, Salesforce is releasing 4…

    salesforce, Salesforce Video, Sales Cloud, sales, salesforce product
    Algoworks Dec 1, 2020
    1,201  Views
    Financial Services Cloud – Release Readiness LIVE, Summer '19

    Financial Services Cloud – Release Readiness LIVE, Summer '19

    Video in Salesforce Cloud Platform

    Hear about some of the new and exciting features that you can expect from Financial Services Cloud in the Summer '19 Release. Highlights include: -…

    Salesforce Records, Cloud Computing, Salesforce Cloud, Salesforce CRM, Financial Services Cloud
    Abhay Jul 12, 2019
    2,115  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.