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
Ramya BalakrishnanRamya Balakrishnan 

How to update a new field value with existing data

Hello All

   I am new salesforce admin/developer. I have a requirement to create a new field(# of Active policy) in Account object which calculate the total no of active policy associated in the account. Whenever a new policy is added or expired, the new field(# of Active policy) in account object  is calculated. I am calculating this in Policy Trigger hander class. It is working fine whenever the policy status is changed or added. Now i need to calculate this field value for all the accounts with existing policy. What is the best way to achieve this?  Dataloader to update field in Policy object ? or Flow builder?

Please suggest ideas.

Thanks
Ramya Balakrishnan
Vineela ProddaturuVineela Proddaturu
Hi Ramya,
You can achieve this by using the process builder but the field gets updated whenever we edit/create the record only.In order to update all the existing record you would need to edit and save all the record which need manual effort. So,I would suggest you to go with the batch class to achieve the same.
Kindly, mark it as best answer. If, it helps you.
Shams TabrezShams Tabrez
To achieve this data loader is an option. It cannot be done with a process builder.