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

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

    Popular Salesforce Blogs

    Salesforce CRM Analytics Comprehensive Overview: Capabilities, Key AI Features and Benefits

    Blog in Salesforce Einstein

    As the demand for accurate foresight intensifies, a new force emerges: predictive analytics. This groundbreaking approach gives organizations the power to forecast future outcomes with…

    Benefits, Comprehensive Overview, CRM Analytics, CRM Analytics Assets, Custom Predictions
    Twistellar Jan 2, 2024
    1,685  Views
    Stuck on the Salesforce Security Review Process

    Stuck on the Salesforce Security Review Process?

    Blog in Others

    The attack vector and evidence of vulnerability associated with each item is listed below with a description of the vulnerability. Remediation steps and additional educational…

    Cross-Site Scripting attacks, Salesforce Security, Salesforce Security Review, Security Review Process
    Abhinav May 4, 2016
    10,514  Views

    The ABC's of Salesforce - All you Need to Know

    Blog in Salesforce

    When you’re new to Salesforce, it’s easy to get lost in the lingo. There’s just so much information to digest that it can be overwhelming…

    API, Application Development, Application Development Platform, Application Programming Interface, Artificial Intelligence
    SkyPlanner Sep 17, 2021
    3,801  Views

    Popular Salesforce Videos

    Salesforce Marketing Cloud Automation Studio

    Salesforce Marketing Cloud Automation Studio

    Video in Marketing, Salesforce Cloud Platform

    Automation Studio is a Marketing Cloud application used to execute multi-step marketing and data management activities on an immediate, triggered, or scheduled basis. Use Automation…

    Salesforce Training, Salesforce Marketing Cloud, Salesforce Video, Salesforce Learning, Marketing
    Neha Yadav Aug 7, 2020
    2,456  Views
    Product Rule Vs Price Rule Salesforce CPQ

    Product Rule Vs Price Rule Salesforce CPQ

    Video in Others, Salesforce Stories

    Product Rule CPQ product rules help ensure sales reps are putting together the right products and bundles every single time. You don’t have to worry…

    Salesforce Training, Salesforce CPQ, Salesforce Video, Product Rules, Product Rule
    Jogender Jun 10, 2020
    6,876  Views
    How to Edit List View Filters in Accounts and Contacts Tabs | Salesforce

    How to Edit List View Filters in Accounts and Contacts Tabs | Salesforce

    Video in Salesforce Training

    Watch this video to learn How to Edit List View Filters in ‘Accounts’ and ‘Contacts’ Tabs. If you find anything confusing or have any questions,…

    Salesforce Training, Salesforce Tutorial, Salesforce Apex, salesforce, Salesforce Video
    Rupal Kakkar Mar 9, 2022
    2,398  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.