You need to sign in to do that
Don't have an account?
Jan Kopejtko 2
Mass changing ownership of records to a related record's owner
Hey guys,
I imported a bunch of records to an object.
Now the record owner is set to 'Data Import' - a custom user for data import so I know which are imported and which are not.
Each record has a lookup to Account. I want to change the record ownership of the imported records to the owner of the related Account.
This sounds quite simple, just execute anonymous apex via console, before that I should make a backup and so on.
But I wonder what is the cleanest apex code for such update of record ownership? How would you do it?
Thanks
Jan
I imported a bunch of records to an object.
Now the record owner is set to 'Data Import' - a custom user for data import so I know which are imported and which are not.
Each record has a lookup to Account. I want to change the record ownership of the imported records to the owner of the related Account.
This sounds quite simple, just execute anonymous apex via console, before that I should make a backup and so on.
But I wonder what is the cleanest apex code for such update of record ownership? How would you do it?
Thanks
Jan
If it is a lot of records, you will need to use a batch class, but I think this is proibably easier to do with DemandTools or DataLoader