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

need to chnage the user using apex class when the current user is inactive.

i have a requirement like if a user is deactived all his assigned activities like tasks events approvals everything should be transferred to a active user using apex class. how to achieve this.Any help?


you will have two options according to your scenario.
by using out of box functionality u can use Mass transfer section in salesforce under data management in admin setup. But this contains some limitation so you need to check before implemention.

Check here

2. Create a trigger on user and get all the relevant records for the respective objects and transfer the ownership......

salesforce is having an option to Mass Transfer Approval Processes..check that also....