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

    Review of Top 5 Free Salesforce Data Cleansing Tools [+ Salesforce Data Cleansing Best Practices]

    Blog in Salesforce Data integration

    Keeping your CRM data clean is not only a technical activity. It also involves a creative mind, time, and deep knowledge of the business nuances…

    API, AppExchange, Ascendix Search App for Salesforce, Automated Data Cleansing, Bad data
    Angie Sep 21, 2021
    2,957  Views

    Salesforce Quotes Best Practices for Quotation Templates

    Blog in Salesforce Tools

    A quotation template is a professional document outlining your products or services, pricing, and terms. It’s more than just a price list; it’s a strategic…

    Configure Price Quote, CPQ, cpq-objects, cpq-solution, Document Template
    Sculptor CPQ Sep 3, 2024
    384  Views
    Create Multiple Records of Salesforce Objects from a Single Page

    Create Multiple Records of Salesforce Objects from a Single Page

    Blog in Salesforce Implementation

    Presently we can create records by click on tabs of their related objects but through the below-given piece of code, we can create records of…

    Custom Objects, Multiple Objects, Object Relationship, Record Data, Salesforce Contact Records
    Archit Mar 29, 2018
    11,765  Views

    Popular Salesforce Videos

    How to Establish a Many to Many Relationship in Salesforce?

    How to Establish a Many to Many Relationship in Salesforce?

    Video in Salesforce Implementation, Salesforce Training

    You can use master-detail relationships to model many-to-many relationships between any two objects. A many-to-many relationship allows each record of one object to be linked…

    Salesforce Beginner Tutorial, Salesforce Tutorial for Beginners, Salesforce Records, Salesforce Customization, Salesforce Custom Objects
    Nauman Feb 13, 2018
    1,840  Views
    Know Why Salesforce Is Secure For Your Business Data

    Know Why Salesforce Is Secure For Your Business Data

    Video in Salesforce Security

    Salesforce.com uses a variety of methods as mentioned in the video - to ensure that your business data is safe, secure, and available only to…

    Salesforce Training, Salesforce Security, salesforce, Salesforce Video, Salesforce Learning
    Neha Yadav Dec 30, 2020
    1,878  Views
    Difference between Workflow Rules and Process Builder in Salesforce

    Difference between Workflow Rules and Process Builder in Salesforce

    Video in Others

    This video explains the difference between workflow rules and process builder. It is divided into four parts : 1. When to use Workflow 2. When…

    Process Builder, Salesforce Video Tutorials, Salesforce workflow rules
    Nauman Jul 11, 2018
    5,958  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.