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

    The endless configuration possibilities with Salesforce data — for phones and tablets

    Blog in Salesforce customization

    So, you decided to go mobile with Salesforce for your sales, field service and further teams that work outside the office doors. Now, you get two options to…

    AppExchange Apps, Business Mobility, Charts, Configuration, Create Button
    Barbora Jan 9, 2019
    4,092  Views

    Gamify Online Community Experiences With ScoreNotch | Salesforce

    Blog in Salesforce Products

    In our previous post, we looked at the limitations of standard gamification on Salesforce-powered communities, and how ScoreNotch enables you to overcome them. In this blog…

    Benchmark Scoring, Built-in Migration, Community Contribution, Community Engagement, Community Member
    Sushmita Mehta Jan 3, 2022
    2,563  Views

    How to Use "WORKBENCH" with Salesforce!

    Blog in Others

    Workbench is a tool designed for administrators and developers to connect with Salesforce organizations. Salesforce Workbench provides support for the Force.com Partner, Bulk, Rest, Streaming,…

    Bulk, ForceDotCom Partner, ForceDotCom Support, Metadata, Metadata Component
    Himanshu May 1, 2016
    22,711  Views

    Popular Salesforce Videos

    Increase ROI by Investing in People | Make Earth Your Business

    Increase ROI by Investing in People | Make Earth Your Business

    Video in

    The video discusses the benefits of businesses that invest in and believe in their employees, customers, and communities. Investing in employee training and upskilling programs…

    salesforce, Customers, Employees, Productivity, Businesses
    Jogender Apr 18, 2023
    979  Views
    How To Use Trailhead To Become A Salesforce Developer

    How To Use Trailhead To Become A Salesforce Developer

    Video in Trailhead

    Trailhead is the fun way to learn Salesforce. In this session we'll show you how to leverage Trailhead to quickly and easily learn Salesforce and…

    Salesforce Tutorial, Salesforce Developer, Salesforce Lightning, Salesforce Administrator, Salesforce Einstein
    harshit Nov 26, 2018
    2,310  Views
    Salesforce For Beginners - Introduction To Salesforce | Salesforce CRM Developement Tutorials

    Salesforce For Beginners - Introduction To Salesforce | Salesforce CRM Developement Tutorials

    Video in Salesforce Training

    Contents for this Salesforce Training Video: 1:05 - Index 1:31 - What is CRM ? (Customer Relationship Management) 2:17 - What is Salesforce CRM? 3:18…

    CRM, salesforce services, Salesforce Learning Steps For Beginners, Best Salesforce Tutorials, Free Salesforce Tutorials
    Jogender Dec 18, 2018
    1,698  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.