0

I have 4 objects: Contact, Attendee, Events, and Event Category. I want to create a rollup field on the Contact object to count total number of Events (where event category = Training) attended by Contact. The Contact and Event objects are related by a junction object called Attendee. See the image to better understand the task:

enter image description here

Is this possible to achieve the required results?

1

The standard rollup fields work only with Master-Detail relationships - e.g. you could have a rollup field on your Event object summing up Attendee records for instance.

In your case I would probably look at using a Flow if you want a declarative approach (record triggered flow upon creation of Attendee record).

If you're happy writing apex then a trigger on the Attendee object that increments a count field on the Contact object would work as well.

In both situations you will have an Attendee record in your hands - you would filter on whether the Event is a 'training' event and if so, increment the field on the Contact object.

3
  • What I understand from this is 1) create a number field on contact 2) create a flow on attendee to update the number field on contact every time an event of type training is linked to it? right? – Hari Ha Mar 3 at 21:30
  • use DLRS to rollup over lookup relationships – cropredy Mar 3 at 22:34
  • @HariHa yes, that's what I meant. Or as cropredy says, you can also install a rollup helper app from the AppExchange that overcomes the limitations of the standard rollup field. If you think you'll regularly want to do rollups over lookups, this is a good idea. – edralph Mar 4 at 13:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.