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

    Einstein Application and Licenses in Salesforce Sales Cloud in 2024

    Blog in Others

    Einstein Lead Scoring Use AI to score your leads by how well they fit your company’s successful conversion patterns. Let your sales team prioritize their…

    Artificial Intelligence, Business Intelligence, CRM Technology, Customer Relationship Management, Einstein Activity Capture
    Vimera | Andersen Apr 11, 2024
    1,945  Views
    Salesforce Sales Cloud

    Your Complete Guide to Salesforce Sales Cloud

    Blog in Sales, Salesforce Cloud Platform, Salesforce Products

    Named the #1 CRM solution in the world, Sales Cloud is Salesforce’s most popular product. In this article, we’ll go through everything you need to…

    Artificial Intelligence, B2B, B2C, billing, Business
    SkyPlanner Jun 25, 2021
    2,623  Views

    Salesforce vs Hubspot: Which CRM is the Best Fit for Your Business Needs?

    Blog in Salesforce

    As companies grow and expand, managing customer relationships becomes a complex and challenging task. This is where customer relationship management (CRM) software comes into play.…

    Attract, Benefits, Best Suited, budget, Business
    Kizzy Consulting Jul 3, 2023
    1,504  Views

    Popular Salesforce Videos

    Escalation Rule in Salesforce

    Escalation Rule in Salesforce

    Video in Others, Salesforce Training

    In this video, Shrey is not only teaching but also demonstrating Escalation Rule in Salesforce. 1. What are Escalation Rules in Salesforce? 2. What is…

    Salesforce Training, Salesforce Tutorial, salesforce, Salesforce Video, Salesforce Learning
    Jogender Apr 19, 2021
    2,006  Views
    Introduction to SOQL in Salesforce

    Introduction to SOQL in Salesforce

    Video in Salesforce Training

    This video explains what is SOQL or Salesforce Object Query Language in Salesforce technology with examples from daily life for your better understanding .

    Free Salesforce Training, Salesforce Integration, Apex, Salesforce Objects, Easy Way To Learn Salesforce
    Prafull Nov 27, 2018
    2,016  Views
    What is the Difference Between Profile Vs Permission Set?

    What is the Difference Between Profile Vs Permission Set?

    Video in Salesforce Admin

    What is the difference between Profile Vs Permission Set? The profile is mandatory for the users in Salesforce. A permission set is one thing that…

    Salesforce Training, Salesforce Tutorial, salesforce, Salesforce Video, Salesforce Learning
    CRS Oct 25, 2021
    2,069  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.