Cleanup - Batch


Cleanup - Batch scheduler job purpose is to delete significant data volumes by segmenting into manageable chunks. Requires a SOQL Query defining records to be deleted.

Consider scenario: We generate logs of some sorts and store them. Next we need to clear those records every 8 hours, so we can use this to solve this problem.

To show you an example how it works, let’s clear Accounts we created in previous step every 2 hours.


Step 1: Register Scheduler Job

To register a new Scheduler Job we need to configure it.

Go to: Breezz SetupScheduler Jobs → Click New

CleaningUpAccountRecords Scheduler Job CleaningUpAccountRecords Scheduler Job

Now we need to input Name and add some Description and select the type of Scheduler Job, in our case it will be Cleanup - Batch. Nextly select Execution Interval 2 hours. Lastly we write a query in SOQL Query which returns id’s of records which you want to delete. So after filling all fields click save and run Scheduler.


Step 2: Check Scheduler Job

To check if a scheduler was created go to App LauncherBreezzBreezz Scheduler Jobs. Here you can see your Scheduler:

CleaninUpAccountRecords in Scheduler Jobs CleaninUpAccountRecords in Scheduler Jobs

You should see the as a record in Scheduler Jobs populated with data that you provided. As well as dates for last and next execution.