You need to sign in to do that
Don't have an account?

Hi I want to write the batch apex.I am updating the field using trigger and i have created the formula fields as well,
Now i want to apply this trigger and formula field values for existing records also,Can you pleas any one tell how to update this
I want to update the custom field - Finish_Code__c from PBSI__PBSI_Item__c object..please help me anyone
I want to update the custom field - Finish_Code__c from PBSI__PBSI_Item__c object..please help me anyone
Let me know if you fall in any problem.
Hope it helps!
Thanks
All Answers
Write a anonymous block of coe updating the records you would like this updations on. So as you update htose records simply you rtrigger will also get calles and your work of formula fields will also be done.
Mark as answer if fits what you wanted.
Thanks
There are some governor limits that you should be aware of with both (e.g. only being able to retrieve maximum of 50,000 rows and only able to update a maximum of 10,000 etc.). If you exceed any of these limits, you may need to employ batch apex. However, if you are just talking about a few records you could do this:
List<PBSI__PBSI_Item__c> pbs = [ Select Id, Finish_Code__c From PBSI__PBSI_Item__c Where CreateDate<Today() LIMIT 50000];
update pbs;
Edit: you could also use dataloader, i.e. extract the records, update the value to true and then update with data loader if you don't want to use Apex.
Let me know if you fall in any problem.
Hope it helps!
Thanks
Database.executeBatch(getuprecs);
I have run this code in execute anonymous window.
So it should be fine now.
So once this batch is suucesfully completed you can check the old records.
And mark it as the answer if you get resolved.
Thanks!