I have a text field named TestId in the object test which is capturing the Id of the record.Actually I have used an automation such as flow to update the value in the text field. Since I cannot make formula fields searchable I had to convert it to a text field. Working for newly created objects but I have to update the earlier created records with this value using anonymous code: How do I do this? Almost 20,000 records to be updated.
List <Test__c> test=testList=[Select Id, Name, TestId From Test__c];
for(test:testList){
}
List <Account> test=[Select Id, Name From Account]; List<Account> accounttoupdate= new List<Account>(); for(Account t:test){ accounttoupdate.add(t); } update accounttoupdate;