+ Start a Discussion
uma52551.3972270309784705E12uma52551.3972270309784705E12 

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!
rohitsfdcrohitsfdc
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 
http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_batch_interface.htm


and to schedule a batch class:
https://help.salesforce.com/HTViewHelpDoc?id=code_schedule_batch_apex.htm&language=en_US

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

Thanks
Rohit