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
Lakshmi SLakshmi S 

I have to change record owner ship from one user to another user on opportunity Object. How can we achieve this?

HI Dev's,

Opportunity object : I have 1 lakh records, how to change ownership from one user to another user?


Thanks in Advance...

Regards,
Lakshmi
sandeep madhavsandeep madhav
Hi,
Hope this helps,

User userdetails = [select id from user where id='Specific user id'];
Get therecords from Object and update the records with ownerid=Userdetails.id;

Thanks,
V V Satyanarayana MaddipatiV V Satyanarayana Maddipati
Hello Lakshmi,

I recommend you to export the Opportunity records through data loader with necessary fields like (Opportunity Id, owner Id)
Change the owner id field value with the new value and update the opportunity records through Apex data loader.


Thanks
Satya.