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
Dhananjay123456789Dhananjay123456789 

update list of record such that all records have series of numbers

I have custom object mycustobj__c
and in this object have custom field custfield__c  this null now
mycustobj__c contains 200+ records
requirment is to fill custfield__c such way that each record have serial no
ex- 1st record mm-01
      2nd record mm-02.

.......
and so on


Thanks for the input!....
SUCHARITA MONDALSUCHARITA MONDAL

Hi Dhananjay,

You can do the following:

1. Write a script (you can run it from developer console) where Query all the records order by Createddate ASC and update the record values with define prefixes as 'MM-01'.
2. After updating change the field into Auto-Number field keeping the same format so that going forward it automatically fills the sequence.

 

Hope this helps!
Thanks,
Sucharita