Toggle Side Panel

  • Blogs
  • 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
  • Contact Us
  • Discussions
More options
    Sign in Sign up
    • Blogs
    • 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
    • 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 10 years, 4 months ago by  Nitish.
      • This discussion was modified 10 years, 3 months ago by  Forcetalks.
      • This discussion was modified 10 years, 3 months ago by  Forcetalks.
      Gourav replied 10 years, 4 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

    Popular Salesforce Blogs

    The Future of Salesforce CRM: Trends and Predictions

    The Future of Salesforce CRM: Trends and Predictions for 2026

    Blog in Salesforce

    Customer expectations continue to change every year. Businesses no longer want a CRM system that stores contacts, tracks opportunities, or generates reports. They want a…

    CRM solution integration, one-to-one conversations, SALES, Salesforce CRM, Salesforce Einstein
    LevelShift (formerly DemandBlue) May 1, 2026
    1,619  Views
    Salesforce Org

    Integration of Two Salesforce Org Using REST API - The Complete Guide

    Blog in Salesforce Apex

    What is Integration in Salesforce? Salesforce integration is the process of incorporating the data and functionality of Salesforce with another operation to give druggies a…

    API Callout, App Manager, auth, Authentication Protocol, Callback URL
    Parvez Alam Nov 11, 2022
    5,811  Views

    The Role of Artificial Intelligence in Modern Lab Management Systems

    Blog in Salesforce Implementation

    Introduction In the constantly evolving healthcare and research fields, artificial intelligence (AI) transforms laboratory operations by improving efficiency and providing accurate results. Modern lab management systems…

    SaaS
    Off page Seo Jan 20, 2026
    240  Views

    Popular Salesforce Videos

    Navy Veteran Turned Solution Engineer Working at Salesforce

    Navy Veteran Turned Solution Engineer Working at Salesforce

    Video in Salesforce Training

    In this video, you know how a navy veteran turned Solution Engineer working at Salesforce. This is really inspiring for everyone. The video covered the…

    Salesforce Training, Salesforce Tutorial, Salesforce Certification, Salesforce Consulting Partner, salesforce
    S2 Nov 10, 2021
    2,093  Views
    Salesforce Heroku Integration | Heroku Connect

    Salesforce Heroku Integration | Heroku Connect

    Video in Salesforce Integration

    Heroku is a cloud platform that lets deploy, run and manage applications and websites. It is part of Salesforce Platform. This video will explain about…

    Salesforce Training, Salesforce Tutorial, salesforce platform, Salesforce Video, Salesforce Learning
    Jogender Jul 26, 2021
    4,975  Views
    Salesforce Health Cloud

    Salesforce Health Cloud

    Video in Salesforce Cloud Platform

    Salesforce Health Cloud is a health IT CRM system that incorporates doctor-patient relationship and record management services. Through Private Communities, patients can view care plans,…

    Salesforce Implementation, Cloud Computing, Salesforce Cloud, Salesforce Health Cloud, Salesforce CRM
    Jogender Oct 27, 2019
    3,542  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®.

    We use cookies to enhance your browsing experience. Please see our privacy policy if you'd like more information on our use of cookies.