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

    CTI Integration With Salesforce: Streamlining Your Business for Maximum Efficiency

    Blog in Others

    In today's fast-paced business world, it can be difficult to keep up with the demands of customers while still maintaining a high level of productivity.…

    Apps, Automatic Logging, Automation, Benefits, Call Activities
    Twistellar Jun 1, 2023
    1,130  Views

    5 Best Sales Cadence Tools for Automating Your Outreach

    Blog in Others

    Today, sales tools are more than simply "nice-to-haves". They assist sales representatives by automating routine processes and increasing overall sales effectiveness to free up time…

    Deals Cadences, Einstein Sales Cloud, Features of Sales Cloud, Implement a Sales Cloud, Sales Cadence
    Twistellar Jan 30, 2023
    1,441  Views
    Marketing Cloud Features

    7 New Salesforce Marketing Cloud Features For Powerful Personalization

    Blog in Salesforce Cloud Platform

    Personalization has become increasingly important for a brand's digital strategy over the past couple of years, as seen. 78 percent of consumers expect businesses to…

    AppExchange, Apple App Store, Applications, Audit-proof System, Automated Systems
    Cynoteck Jun 24, 2022
    5,732  Views

    Popular Salesforce Videos

    Salesforce To Salesforce Integration Using REST API

    Salesforce To Salesforce Integration Using REST API

    Video in Salesforce Integration

    Salesforce to Salesforce integration using REST API. In this video, you will learn how two Salesforce Orgs can be integrated using REST API. This tutorial…

    Salesforce Training, Salesforce Tutorial, Salesforce Integration, salesforce, Salesforce Video
    Algoworks Apr 8, 2021
    2,105  Views
    The Future of Salesforce App Dev with Parker Harris & Friends

    The Future of Salesforce App Dev with Parker Harris & Friends

    Video in Trailhead

    Join Parker Harris, Salesforce product managers, and engineers as we kick off Day 2 of TrailheaDX with an in-depth look at exciting new features coming…

    Salesforce Developer, Salesforce Einstein, Salesforce CRM, Salesforce Tools, Salesforce Automation
    Prafull Apr 5, 2018
    2,334  Views
    Pass Salesforce Certification Exam In Your First Attempt

    Pass Salesforce Certification Exam In Your First Attempt

    Video in Salesforce Stories

    This Salesforce Training Video will help you understand the concepts of Salesforce and Salesforce exam so that you can pass the Salesforce exam in the…

    Salesforce Training, Salesforce Certification, Salesforce Developer, Salesforce Community, Salesforce Tools
    Simplilearn Apr 23, 2019
    1,670  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

    © 2025 - 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.