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

    application solution

    Popular Salesforce Blogs

    salesforce dx

    Salesforce DX – The X Factor For Salesforce Developers

    Blog in Others, Salesforce

    Dreamforce always comes with a box of tech surprises every year. 2016 was no exception, one of the big points of discussion was Salesforce DX.…

    Apex Salesforce, Build Your App, Develop Salesforce Apps, Developer Guide, Development Lifecycle
    Algoworks Apr 29, 2020
    1,965  Views

    All You Need to Know About the Salesforce Service Cloud

    Blog in Salesforce Products

    Elevating Customer Support: Unveiling the Power of Salesforce Service Cloud In today's fast-paced and interconnected world, providing exceptional customer service has become a cornerstone of…

    Artificial Intelligence, Automated Workflows, Automation, Brand Reputation, Business Efficiency
    Mukilan Sep 4, 2023
    1,345  Views
    custom lookup

    Custom Lookup Field in Visualforce Page | Salesforce Developer Guide

    Blog in Visualforce

    We all know about the Standard Lookup functionality, it's provided by Salesforce. The standard Lookup field gives a dialog box that supports a little quantity…

    Custom Controller, Custom Lookup Field, Dialog Box, Lookup Field, Salesforce
    Shweta Aug 5, 2020
    24,339  Views

    Popular Salesforce Videos

    What are Apps in Salesforce?

    What are Apps in Salesforce?

    Video in Salesforce Apps

    Apps in Salesforce are Service, Marketing, Content, Salesforce Chatter, Service Console, Salesforce CMS, Test, Sales, Salesforce Scheduler Setup, Community, Sales Console, Lightning Usage App, Bolt…

    Salesforce Training, Salesforce Chatter, Salesforce Online Training, Salesforce Apps, Marketing
    CRS Feb 9, 2022
    2,765  Views
    How to use Einstein Engagement Scoring in Salesforce Marketing Cloud

    How to use Einstein Engagement Scoring in Salesforce Marketing Cloud

    Video in Marketing, Salesforce Cloud Platform, Salesforce Einstein

    Cameron Robert shows how to gain actionable insights from the Einstein Engagement Scoring Dashboard in Salesforce Marketing Cloud, and talks through a few activity ideas…

    Salesforce Training, Salesforce Tutorial, salesforce, Salesforce Einstein, Salesforce Marketing Cloud
    Cameron Sep 20, 2021
    3,454  Views
    Learn About the Before Trigger in Salesforce Flows

    Learn About the Before Trigger in Salesforce Flows

    Video in Salesforce Admin

    Here I am creating 2 scenarios for before - Save Updates in Salesforce Flows Salesforce Summer '20 Flow Builder feature. Creating or updating a record…

    Salesforce Training, salesforce, Salesforce Admin, Salesforce Video, Salesforce Learning
    Shubham Nov 17, 2020
    1,481  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.