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
Marry SteinMarry Stein 

Apex: transfer multiple objects (accounts, opportunities, activities)

Hi guys ! 

i am looking for a way to transfer multiple objects (Accounts, Opportunities and Tasks) to a new owner. 

I can store each object in an individual list and update the owner, but i think there should be a better solution than that. Probabily to store it in a map but can't figuare it out, how to do it. 

Greetings Marry
Best Answer chosen by Marry Stein
Marry SteinMarry Stein
Hi Shirisha,
hanks for your response, but  i have found a way to handle it. I have used the documentation here:
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_methods_system_id.htm
  
I have passed a list of sobjects instead of the id:

Greetings Marry
 

All Answers

ShirishaShirisha (Salesforce Developers) 
Hi Marry,

Greetings!

As per my knowledge it is not possible to do the mass tranfers of multiple Objects at a time as it might cause any issues.

Reference:https://help.salesforce.com/articleView?id=admin_transfer.htm&type=5

Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future.

Warm Regards,
Shirisha Pathuri
Marry SteinMarry Stein
Hi Shirisha,
hanks for your response, but  i have found a way to handle it. I have used the documentation here:
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_methods_system_id.htm
  
I have passed a list of sobjects instead of the id:

Greetings Marry
 
This was selected as the best answer