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 can we get the distinct account name of account object on Salesforce?

    Tagged: Account, Person Account, Salesforce Objects

    • Salesforce® Discussions

      How can we get the distinct account name of account object on Salesforce?

      Posted by Mohit on July 21, 2016 at 3:17 PM

      Hi all,

      How can we get the distinct account name of account object on Salesforce?

      Please give suggestions.

      • This discussion was modified 10 years, 3 months ago by  Mohit.
      • This discussion was modified 10 years, 3 months ago by  Forcetalks.
      • This discussion was modified 10 years, 3 months ago by  Forcetalks.
      Sourabh replied 10 years, 3 months ago 2 Members · 1 Reply
      • Account
      • Person Account
      • Salesforce Objects
    • 1 Reply
    • Sourabh

      Member
      July 25, 2016 at 6:59 AM

      Hi Mohit,

      Giving you the code for getting distinct Account name using 'set'...

      List<Account> acclist = new List<Account>();

      Set<String> setName = new Set<String>();

      acclist = [select id,Name other fields from Account] ;

      for (Integer i = 0; i< acclist.size(); i++)

      {

      setName.add(acclist[i].Name); // It will contains distinct accounts.

      }

      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

    SalesforceIQ

    Will Salesforce IQ Increase Your ROI?

    Blog in Salesforce Products

    Salesforce just got more intelligent. Salesforce had purchased RelateIQ ‘a relationship intelligence platform’ and has incorporated the engine to multiply its strength manifold and has…

    AppExchange, Business Relationships, Chrome Extension, Cloud Storage Services, CRM
    Algoworks May 8, 2020
    3,120  Views

    How Does Salesforce Genie Impact Your Business?

    Blog in Data, Data Migration, Salesforce

    Salesforce Genie, a real-time platform, powers customer magic. Your teams are able to meet your customers where they are unlike ever before by harmonizing data…

    Best Practices, Business, Commerce, Compliance Standards, Customer 360
    Apphienz Nov 15, 2022
    2,876  Views
    Send Salesforce Record Data { as Email functionality } via WebMerge

    Send Salesforce Record Data {as Email functionality} via WebMerge

    Blog in Data, Salesforce Implementation, Salesforce integration

    WebMerge is a great platform that allows our data to populate different types of documents and send it to various other platforms or contact automatically…

    Email in Salesforce, EmailMessage, Merge Fields in Salesforce, Record Data, Record Related List
    PRANAV Jan 29, 2018
    4,780  Views

    Popular Salesforce Videos

    How to Take Your Salesforce Support Model to the Next Level

    How to Take Your Salesforce Support Model to the Next Level

    Video in Salesforce Stories

    Jeremy Muldoon, the Salesforce expert at Rimini Street, discusses the Salesforce resource challenges faced by businesses today, how to overcome them, and how to take…

    Salesforce Training, Salesforce Tutorial, salesforce, salesforce platform, Salesforce Video
    Nauman Feb 11, 2022
    2,020  Views
    How to Report on the Reports in Your Salesforce Org

    How to Report on the Reports in Your Salesforce Org

    Video in Others, Salesforce Training

    Do you want a list of all the reports in your Salesforce org? Would you like to see a list of reports and the last…

    Salesforce Training, Salesforce Tutorial, Salesforce Reports, Salesforce Org, Salesforce Video
    Rupal Kakkar Mar 25, 2021
    2,217  Views
    Salesforce Lightning Training

    Salesforce Lightning Training

    Video in Lightning, Salesforce Certifications, Salesforce Training

    Here, the video is about the Salesforce Lightning Tutorial. These video covers comprise real-world projects that will introduce you to advanced concepts such as Lightning…

    Salesforce Training, Salesforce Tutorial, Salesforce Certification, Lightning App Builder, Lightning Components
    hyderabad courses Dec 16, 2021
    2,055  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.