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
Timmy AhluwaliaTimmy Ahluwalia 

Execute Bulk Trigger

Hi,
We have one bulkified trigger on custom object.
i want to use that same trigger to update all the records in the system, how can i execute the trigger which will update 1000 records in the system.
Thanks. 
Raj VakatiRaj Vakati
You can do it like below .. 

Export the data in csv and reload the same data again to meet the trigger execution conditions and set batch size as 1000 while loading data

 
Timmy AhluwaliaTimmy Ahluwalia
Thanks for the answer if there are 10000 records is there any way of doing it, becuase exporting 10000 records and laoding again will become difficult.
Thanks
Deepesh Rao 9Deepesh Rao 9
Better would be to create a batch class for the records with the same logic as in trigger and run it once so even if you have 50k records this will work
Rameshwar gaurRameshwar gaur
Use batch class on same logic as Trigger.
That will solve your problem.
But Before doing that you have to thing what condition you use to invoke the trigger.
Make sure running the batch class not invoke your trigger.
Its best if you deactivate your trigger before runnung your batch class.
If you have any  more query feel free to ask i will try to help you as much i can.
Deepesh Rao 9Deepesh Rao 9
perfect bro, same idea as mine 
Timmy AhluwaliaTimmy Ahluwalia
Thanks to all. Get back to you after testing.