+ Start a Discussion
Sravanthi SunkariSravanthi Sunkari 

change the field value dynamically

I have a custom object 'CO'. On this I have a standard Name field 'COName' of data type Text(80).
Some of the records on this object have the COName values in the number format '0000'.
Some of them have COName values which include some text in it like 'xxx000000'.
I want the field COName values with only numbers in the field value to change to the format  'xxx000000'.
I tried workflow but it fires only either when record is created or pdated. But I want them dynamically change.
I have nearly 600 records for which this change has to be done. these records have been created from past 5 years.
Can any one help me how to do this either by coding in Visual force or apex or any other way.
Once these changes have been done I am planning to change the data type of this field to Autonumber for maintaining the consistancy.
 Thanks.
Note: I am new to coding. So a detailed explanation with code shall be appreciated.
 
Best Answer chosen by Sravanthi Sunkari
viruSviruS
Export all records from your org in csv using dataloader with id field only. and again update the records using same csv. Your workflow will do the same what you need on update event for all records. No Need to write apex code.

if you wants apex code then  I think you should create a batch apex do the same like update the record. You can execute that batch class from execute anonymous developer console 

All Answers

viruSviruS
Export all records from your org in csv using dataloader with id field only. and again update the records using same csv. Your workflow will do the same what you need on update event for all records. No Need to write apex code.

if you wants apex code then  I think you should create a batch apex do the same like update the record. You can execute that batch class from execute anonymous developer console 
This was selected as the best answer
Sravanthi SunkariSravanthi Sunkari
Wow Thanks Virus. It worked like a magic. Thanks alot.