function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
BBSalesforceBBSalesforce 

Count number of times a contact has been contacted

Hi,

 

 

We want to be able to create campaign member list for contacts whom we have not contacted for more than 6 times for the past 6 months. Is there a standard way to do it ?

 

best Regards,

Brian

jkucerajkucera

You can do it 1 of 2 ways:

1) Create campaign member report grouped by first name/last name with a count 

2) Create a campaign member trigger to mimic a rollup summary field

 

2 is probably the more usable way to do this.  The trigger would increment the "Campiagn Member Count" on Lead/Contact every time a member is created.  You should create a 2nd trigger to decrement the count when a campaign member is deleted as well.

 

I believe I posted sample syntax on how to do this somewhere else in the discussion boards but can't find that post right now.

jkucerajkucera

Forgot to add - to do the 6 month rolling window w/ triggers, you'd have to specify a created date range in the queries for the campaign member count.  That complicates thing a bit, but is still doable.

 

[SELECT ID, ContactID FROM CampaignMember WHERE CreatedDate>: TodayMinusSixMonths AND ContactID IN: Contacts]

BBSalesforceBBSalesforce

Thanks on the answer. We wanted to see if it was possible to do it without going thru some programming.

In case we want now to track the interaction with the contact thru the count of number of actions associated with the contact ? For eg. a phonecall... an email is counted as 2 interactions with the contact.