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

    Configure Salesforce SAML Single Sign-On in 2024

    Blog in Salesforce integration

    Configuring Salesforce SAML Single Sign-On (SSO) is a critical step in enhancing both the security and user experience within your organization. SAML (Security Assertion Markup…

    Assertion Consumer Service, Authentication Certificate, Authentication Flow, Authentication Parameters, Authentication Security
    Kizzy Consulting Sep 9, 2024
    502  Views

    5 Significant Benefits of Salesforce CRM Testing

    Blog in Salesforce, Salesforce Stories

    Providing superior customer service is no longer a choice for businesses, it has rather become a necessity to sustain in this competitive world. However, providing…

    Business Operations, Business Process, CRM, CRM Platform, CRM systems
    Girikon Dec 15, 2022
    1,699  Views

    Benefits of Salesforce Commerce Cloud for eCommerce Business

    Blog in Salesforce Cloud Platform

    To stay competitive, retailers realize the importance of incorporating multiple channels into their sales and distribution. In the past 20 years, the number of people…

    Artificial Intelligence, Artificial Intelligence-based Platforms, B2B, B2B eCommerce, Business Tools
    Innovadel Aug 22, 2022
    2,377  Views

    Popular Salesforce Videos

    Create Custom Auto Number Field With Your Criteria Using Flows | Salesforce

    Create Custom Auto Number Field With Your Criteria Using Flows | Salesforce

    Video in Salesforce Training, Salesforce Automation

    Have you ever want to have an auto number field but it only populates when certain criteria were met on a record? Now you can…

    Salesforce Training, Salesforce Tutorial, salesforce, Salesforce Video, Salesforce Learning
    Warren Oct 21, 2020
    12,842  Views
    Control Access to the Org | Data Security | Salesforce

    Control Access to the Org | Data Security | Salesforce

    Video in Salesforce Security

    In this video, wonder Studies explains how to control access to your Salesforce org and the data security measures you can take to protect your…

    Salesforce Training, Salesforce Tutorial, Salesforce Security, salesforce, Salesforce Org
    Mayra Nov 1, 2022
    1,664  Views
    Integration: MuleSoft Composer for Salesforce

    Integration: MuleSoft Composer for Salesforce

    Video in Salesforce Integration

    What you can do with MuleSoft Composer for Salesforce Enrich your 360-degree customer view by empowering your Salesforce admins with a no-code solution for quickly…

    Salesforce Training, Salesforce Tutorial, Salesforce Integration, salesforce, Salesforce Admins
    Prafull Jan 29, 2021
    2,471  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.