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 to count unique accounts from the campaign member related list?

    Tagged: Account, Related List, Salesforce Apex, Salesforce SOQL, Salesforce Trigger

    • Salesforce® Discussions

      How to count unique accounts from the campaign member related list?

      Posted by Nitish on April 30, 2016 at 5:23 PM

      How to count unique accounts from the campaign member related list on the campaign detail page?

      • This discussion was modified 9 years, 9 months ago by  Nitish.
      • This discussion was modified 9 years, 9 months ago by  Forcetalks.
      • This discussion was modified 9 years, 9 months ago by  Forcetalks.
      Gourav replied 9 years, 10 months ago 2 Members · 1 Reply
      • Account
      • Related List
      • Salesforce Apex
      • Salesforce SOQL
      • Salesforce Trigger
    • 1 Reply
    • Gourav

      Member
      June 2, 2016 at 1:57 PM

      There is no configuration through which this can be achieved easily. This can be done via a trigger.

      Create a trigger on CampaignMember for after insert, after update, after delete and after undelete.
      Get the unique campaign Ids from Campaign Members
      Create a aggregate query and group by Campaign Id and Account Id.
      The aggregate query should be able to give you the unique count which you can update on Account. You might also require triggers on Contact and Account for handling situations such as Account update on Contact, Contact deletion, Account deletion.

    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

    Case Study: Salesforce Pharma Order Management System Transformation

    Blog in Salesforce

    Key steps are taken to optimize operational efficiency and Salesforce integration in the pharmaceutical industry. Managing orders across diverse markets presents challenges that demand innovative…

    Business Operations, Business Process, Case Study, Code Expansion, CRM
    Triple Innovations Dec 19, 2023
    1,344  Views
    Salesforce Chatter

    Understanding Salesforce Chatter and Its Implementation

    Blog in Salesforce

    Chatter is a place for collaboration in Salesforce where you can post chatter feeds, share files, create new events, and create interactive user polls.  In…

    App Launcher, Archived, Business Information, Chatter, Chatter Feeds
    Narendra Sa Feb 21, 2022
    4,690  Views
    Dreamforce 2024: What can you look forward to?

    Dreamforce 2024: What Can You Look Forward To?

    Blog in Others

    Table of Contents   Dreamforce 2024 Learn the Hows and Whys of Trusted AI Be on the Cutting Edge of AI Navigate Future Trends Plan…

    Business Growth, Customer Engagement, Customer Satisfaction, Digital Initiatives, Digital Strategies
    Kizzy Consulting Jun 20, 2024
    904  Views

    Popular Salesforce Videos

    Build Your First Salesforce IoT Project in 20 Minutes

    Build Your First Salesforce IoT Project in 20 Minutes

    Video in Internet of Things

    Join us to see how you can build your first Salesforce IoT orchestration in less than 20 minutes! You will learn a quick overview of…

    Salesforce IoT, Salesforce IoT Project, Salesforce IoT Tutorial, Salesforce IoT Development, Salesforce IoT Training
    Prafull Apr 24, 2018
    2,580  Views
    What are Salesforce Editions and Pricing in Details?

    What are Salesforce Editions and Pricing in Details?

    Video in Salesforce Admin

    Salesforce Editions and Pricing - Salesforce are providing four types of licenses Essentials, Professionals, Enterprise and Unlimited. Watch the video and if you have any…

    Salesforce Training, Salesforce Administration, Salesforce CRM, Salesforce Editions, Developer Edition
    CRS Apr 6, 2022
    3,263  Views
    Build Smarter Apps with Einstein Object Detection

    Build Smarter Apps with Einstein Object Detection

    Video in Salesforce Integration, Salesforce Einstein, Salesforce Implementation, Salesforce Apps

    Einstein Object Detection allows you to easily integrate advanced computer vision technology into your Salesforce workflows and external applications. Join us and learn how to…

    Salesforce Applications, Salesforce Apps, Salesforce Einstein, Salesforce Objects, Enterprise Application Development
    Shiv Kumar Sharma Apr 3, 2018
    2,049  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.