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
jotr408jotr408 

Mass update?

So I have a custom object.  Each record in that object will have a field (prepaper).  Now this field can have many duplicates because a preparer can own many records.  So now I have like 10 different prepapers that are linked to many records.  If I want to update the names of the preparers, what's the best way to go about this?  Is there an update query in force like there is in MS Access?  

Ritesh AswaneyRitesh Aswaney

If I've understood this right, this one seems to be more a data model question rather than an implementation question.

 

Ideally, you'd normalise your data and have a Preparer Table, which holds the preparer master data.

Your custom object could then have a lookup to this Preparer Master Data table to indicate the relationship with the relevant preparer.

 

To update names, then you just need to update the singular records in your Preparer Master Data Table. Yes update exists.

eg Preparer__c preparer = [Select Id, Name from Preparer__c where Name = 'Old Name' LIMIT 1];

preparer.Name = 'New Name';

update preparer;

 

If you have a business need to have the names of the Preparers showing on your custom object too, then you could have a Cross Object Formula field, pulling through the Name values from the relevant Preparer Record.