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

Batch Apex to update the Priority Field in Case

Can Any one help me how to write the batch apex and schedule it to update the priority field to high when the case age touches 10 days.

I am having a custom field call Age__c which is a formula field that will calucalte the opend day to closed date difference and gets the age. Now I have to update the priority to high if the age touches 10 days by batch apex. Workflow and apex trigger won't work for this. Thanks in advance!
Hello there,
You will need to schedule your batch class every day to check what all cases has reached age equals 10 days. If true, update the priority.

More details about batch class can be found at

and to schedule a batch class:

Let me know if you have any query. else please mark this as the best answer.