You need to sign in to do that
Don't have an account?
Pavan_NM
Change ownership of records using batch apex
Hi Experts,
I have requirment
1. I need to fetch all the inactive users (IsActive==False),
2. if the inactive users having ownership for records on object Acocunt, Contact,Opportunity, we have to change record ownership to its imidiate manager assigned to that users.
3. for this we required batch class and sechudular which runs daily basis, covering all 3 objects iterative maner so no Apex cpu limit error occure
Kindly help me out.
Try Below Code Please Mark It As Best Answer If It Helps
Thank You!
try below code but before apply it make sure your user managerId is not empty otherwise you can get error.
don't forget to mark it as best answer.
thank you
Thanks for reply,
for one or more users I have more than 50k records using all objects in batch,
can we make this batch Iterable to make it work for more than 50k records?
this batch giving error -- Too many query rows: 50001
is it possible to avoide this error?
Thanks for support,