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
SapamrmSapamrm 

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,

 

Martijn

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

 

 

 

 

SapamrmSapamrm

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?