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 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 9 years, 9 months ago by  Mohit.
      • This discussion was modified 9 years, 9 months ago by  Forcetalks.
      • This discussion was modified 9 years, 9 months ago by  Forcetalks.
      Sourabh replied 9 years, 9 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

    [adinserter block="12"]

    Popular Salesforce Blogs

    All You Need to Know About DupeCatcher Salesforce

    Blog in Others

    Duplicate records can be a headache for any Salesforce admin or user. Not only do they clutter up the database and make it difficult to…

    Best Practices, Bulk Import, Clean, Compliance, Configuration
    Rahul Jun 2, 2023
    1,613  Views

    Omni-channel setup in quick 15 minutes…

    Blog in Salesforce Implementation

    Omni-Channel enables your contact center to push work to the most qualified, available support agent in your organization in real time. Omni-Channel lets you create work…

    Case Routing, Omni-Channel, OmniChannel Routing, Salesforce Feature
    Guha Sep 28, 2017
    28,950  Views

    Driving Operational Excellence with Lightning-Powered Enterprise Apps and Salesforce Development Partners

    Blog in Salesforce

    For a business to perform optimally and grow sustainably, its core and supporting departments, including marketing, sales, services, and human resources, require digital solutions to…

    API Binding, Business Processes, Client Management, Cloud Architecture, Cross-Platform Compatibility
    Carol Aug 8, 2024
    585  Views

    Popular Salesforce Videos

    Salesforce Lightning User Tips & Tricks Spring 2021

    Salesforce Lightning User Tips & Tricks Spring 2021

    Video in Lightning

    This session is one of our most popular Webinars. It includes tips and tricks that any Salesforce user will find helpful. Learn Salesforce shortcuts that…

    Salesforce Training, Salesforce Lightning, Salesforce Classic, Salesforce Webinar, Salesforce Video
    Abhishek Sep 8, 2021
    4,541  Views
    Open Facebook Messenger and Send Message using Lightning Component Salesforce | Salesforce Tutorials

    Open Facebook Messenger and Send Message using Lightning Component Salesforce | Salesforce Tutorials

    Video in Salesforce Training, Salesforce Development

    In this video you will learn to open Facebook Messenger and send message to users using their facebook's username. We will create a quick action…

    Salesforce Training, Salesforce Tutorial, Salesforce Development, Salesforce Lightning, salesforce
    Kapil Jul 16, 2020
    2,257  Views
    Salesforce Platform Quick Tip: How to Use Einstein Search

    Salesforce Platform Quick Tip: How to Use Einstein Search

    Video in Salesforce Training

    Want to improve your searches in Salesforce, and make them faster and more intuitive? In part one of this 2 part series, Trailblazer and Salesforce…

    Salesforce Training, Salesforce Tutorial, Salesforce Administrator, salesforce platform, Salesforce Einstein
    Prafull Oct 22, 2021
    1,840  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.