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
Priya 212213Priya 212213 

Trigger of multiple objects with same class

Hi,

I have an scenario where I want to pass list of Object's records as an argument to the class from trigger. This class can be used in triggers of multple objects in which trigger.old of that particular passed to this class's method. Those objects has same lookup field in common. I want to check the field named status of that lookup field and to do some actions with that.
 

Can any one please suggest me some code.

ShirishaShirisha (Salesforce Developers) 
Hi Priya,

Greetings!

I don't think this is that easy to use one handler for all the Triggers on multiple Objects as you need to refer the Objects and some of them doesn't have any relationship between them.

Also,we have an idea created for the trigger to have separate one for the each Object.

https://trailblazer.salesforce.com/ideaView?id=08730000000wkTKAAY

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

Warm Regards,
Shirisha Pathuri