+ Start a Discussion

Formula/Roll Up Summary field for Activity Counter possible?

Plain and simple (and it blows my mind that SFDC cannot do this) we want to have a field on the Account, Contact, Lead, and Opportunity record pages that shows a total of the number of activities that have been completed with them. We want to be able to run reports such as Leads with less than 5 activities since creation or Accounts with no activity in the past 30 days, etc.


Can anyone think of a way to write a formula field (dont think roll-up summary fields work for this) that could do this. I cant get a field update on the Account page for example to read anything from Activity History...


I cant be the first one to talk about this before and Im surprised I havent even found an App that does exactly this (at least not by my searches).


You have to use a simple trigger for this purpose. Write the trigger on Activity Object, whenever an activity is closed there will be a field say count in Account which will be incremented. Also you have to put logic to decrement the count if a closed activity is deleted and on edit event if an activity is opened from  closed status.


Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved.


I unfortunately do not have the skill set to write code for a trigger. Salesforce Premier Support said they exhausted all thoughts of being able to do this without a custom trigger, but unfortunately, I cannot get the OK for another $600 trigger from Salesforce's support.




Build reports and group them by Accounts, Contacts and Opportunities and do the record count of Activities. You'll get the number and you can build some really good dashboards also if you want.


In theory this sounds like a decent idea, except with over 120,000 Accounts and almost 200,000 Contacts, and thousands of Leads, its just not possible. We want users to be able to run a report that says "show me all Leads with less than 5 activities". This is not possible. I can run a report of all activities with Leads, and group them by Leads, but then we are talking about a report that will quickly max out on the screen, and contain far more data than what we want the user to see at one time.

its quite frustrating that SFDC does not have this capability. One of the key points of interest in sales is the quandry of how many touches does it take to get the sale... Who knows with Salesforce!


Actuaally activity(Task) is a very gaurded entity, there are many thing which are easily doable with normal objects  like rollup fields or Summary fields.As you said at times it gets very frustrating- we can create an idea and promote it to make salesforce open up this object in the next release , please go ahead and post the idea.


Here is a very close Idea to what I am looking for. Ideally we would hope that if it goes under consideration, it is implemented for more than Opportunities, but since this one already has some backers, I say just promote this one!