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, 2 months ago by  Nitish.
      • This discussion was modified 10 years, 2 months ago by  Forcetalks.
      • This discussion was modified 10 years, 2 months ago by  Forcetalks.
      Gourav replied 10 years, 2 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

    All You Need to Know About the Salesforce Service Cloud

    All You Need to Know About the Salesforce Service Cloud

    Blog in Salesforce

    In this Blog, we will take a look at the topic of Service Cloud in Salesforce. As Customer service has a greater impact on the…

    Consumer, Consumer Experience, Customer, Customer Inquiries, Customer Interactions
    bhawana Mar 28, 2023
    2,019  Views
    Salesforce - The Best CRM For Startups

    Salesforce - The Best CRM For Startups

    Blog in Salesforce

    It is one of the biggest misconceptions that CRM is only for big companies and organizations. In fact, CRM when implemented correctly right from the…

    Brand Loyalty, Business, Business Cards, Business Growth, Business Process
    Apphienz Jul 22, 2021
    1,993  Views
    Document Workflow Automation: To Implement or Not?

    Is It a Good Idea to Implement Document Workflow Automation in Salesforce?

    Blog in Salesforce Implementation

    What is a Document Workflow? A document workflow is the process of routing, reviewing, approving, and managing documents within an organization. Document workflow software can…

    automatic-document-generation, Customer Data, Customer Interactions, Customer Relations, Customer Relationships
    Rajeev Jan 16, 2023
    2,190  Views

    Popular Salesforce Videos

    How to Become Salesforce Developer in 2022 | Salesforce Career Path

    How to Become Salesforce Developer in 2022 | Salesforce Career Path

    Video in Salesforce Training

    Anyone can become a Salesforce developer. It takes to learn Salesforce-specific developer skill sets and does not account for time spent in formal education or…

    Salesforce Training, Salesforce Tutorial, Salesforce Jobs, Salesforce Developer, Salesforce Career
    Jogender Jan 19, 2022
    1,821  Views
    What is Field Dependency in Salesforce and When to use it?

    What is Field Dependency in Salesforce and When to use it?

    Video in Salesforce Implementation

    This video gives a complete knowledge of what Field Dependency is in Salesforce. It's divided this topic into 4 major points that are: 1. What…

    Salesforce Tutorial, Salesforce Beginner Tutorial, Salesforce Field Objects, Salesforce Fields, Field Dependency In Salesforce
    Prafull Feb 7, 2018
    2,281  Views
    How to Get Salesforce Developer Certification | Salesforce Certification

    How to Get Salesforce Developer Certification | Salesforce Certification

    Video in Salesforce Certifications, Salesforce Training

    A Salesforce developer certification is a credential that verifies a professional has the necessary skills and knowledge to design custom applications and analytics functions on…

    Salesforce Training, Salesforce Certification, salesforce platform, Salesforce Video, salesforce developer certification
    Jogender Nov 25, 2020
    2,058  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.