You need to sign in to do that
Don't have an account?
Srujana Reddy
How to Update the Case status using trigger
How to Update the Case status to Closed using trigger When ClosedDate is Today.
can any one help me.
Thanks in advance
can any one help me.
Thanks in advance
The way you'd do that is by creating a time-dependent workflow action. Essentially, you place the case in the workflow queue as soon as it is Active and has an Expiry Date, and then Salesforce will wait until the Expiry Date arrives and update the record to Expired.
Here are some guidelines to setting your workflow:
1) Go to Setup > Create > Workflow & Approvals > Workflow Rules
2) Click New Rule, then select Case
3) Give your rule a name, leave the evaluation criteria on 'created, and any time it’s edited to subsequently meet criteria'
4) Specify your Rule Criteria, which I think should be Case Status equals Active and Case Expiry Date not equal to (leave it blank).
5) Click Save and Next
6) Add a Time Trigger of 0 Days After Expiry Date - then click Save
7) In your Time-Dependent Workflow Action, click Add Workflow Action > New Field Update
8) Give your Field Update a name, select Expiry Date and then select a specific value of Expired
9) Click Save, click Done, click Activate
10) Test your new rule using the Time-Based Workflow option in Setup
SFDC Ravi Kumar thank you for Your Response
Actually I want to do with the help of Trigger.
If this resolves, kindly mark it as best answer
NOTE:- Trigger will only execute when you will update any record it will not pick any record automaticly.
For your requirement you need batch job. Please check below post for Batch Job
1) http://amitsalesforce.blogspot.com/2016/02/batch-apex-in-salesforce-test-class-for.html
Try below sample Batch job
Let us know if this will help you