+ Start a Discussion
Ken Koellner 7Ken Koellner 7 

Detect or prevent Lead/Contact Owner change updating Activity/Event Owner?

I know that when a Lead and an open Event are both ownere by user "A" and the Lead owner is updated to user "B" then the Event owner is automatically updated to have Owner "B".  I'd like to prevent that, or at least detect it so that I can do something down stream.

When I put debug on and update the Lead, I do not see Event udpate triggers fire.  Even the the Event is updated, the owner changes, and the Last Modified Date changes, it's as if no update DML happened.  I suspect that I can't do any work with an Update Trigger on Event to handle this situtation.

I suppose I could put an update trigger on Lead, then in that trigger do a query for open Events owned by the Lead, but I really don't want to get in the game of implementation another trigger.  I already have a trigger on Event that handles when the Owner may be updated and any other activity associated with the Event Owner change.
ShirishaShirisha (Salesforce Developers) 
Hi Ken,

Greetings!

You can actually try by using the Flow with the process builder.While editing/updating the record you can store the previous value of Event Owner and update the Owner whenever the Lead owner changed.

Kindly mark it as best answer if it helps so that it can help others in the future.

Warm Regards,
Shirisha Pathuri
Ken Koellner 7Ken Koellner 7
I would assume any automation, be it a trigger, flow, process builder of Lead/Contact would handle it.  But it would be more elegant to handle it directly from Event.  The process builder / flow suggestion only helps if a process build / flow will fire off Lead/Contact when a trigger will not.