+ Start a Discussion

Roll-up summary: activities on custom object

Hi all,


I would like to track whether or not an activity is logged for a custom object record.

Since it's not possible to create roll-up summary fields for activities, it has to be done by a trigger.

Since I don't know much about triggers, I'm here to ask for help!


So basically I need a custom field on my custom object which increments with 1 as soon as an activity is logged. (only events will be logged and normally max. one event will be logged for each custom object record).


Could anyone please help me this (for you guys very simple) trigger?



Thanks in advance!


Best regards,



Suresh RaghuramSuresh Raghuram

Hi from the data you provide

the trigger will be looks like this. It is just for reference

Create a custom field that needs to get increment depending on the activites

trigger <trigger name> on <obj name>(after Insert, after update){


create an instance for the object whose activity to be detected.

obj name xx= new obj name();

query for the activity updates and update the field on the custom obj




It is just for the idea if you could share more data i can help you






Hi Suree,


I really appreciate you trying to help me.

A lot can be achieved with triggers, but the problem is that I have no experience with, nor technical knowledge about Apex.


I know the logic behind the trigger, what needs to happen, but I don't know how to set it up (syntax, testing, etc..)


What more info/data do you exactly need?