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
james feudojames feudo 

Time Based Workflow in Salesforce

I need to update a custom field with number increasing every hour, I tried using time based workflow but unable to get. Can someone please help me,
Best Answer chosen by james feudo
AbhishekAbhishek (Salesforce Developers) 
you should be able to achieve this with a Time-based workflow.

Let's assume the field you want to update is called hour counter

1. Create the workflow with evaluation criteria - created, and every time it's edited

2.Select "formula" rule criteria and in the formula enter ISCHANGED(hour_counter__c) || ISNEW()

3. Save the rule and click on Add Time Trigger

4.Set it to be executed after 1 hour of Rule Trigger Date

5. In the "Add Workflow Action" section you can add a field update with formula IF( ISBLANK(hour_counter__c), 1, hour_counter__c + 1) (if you're using a default value for the field, you don't have to add the ISBLANK check, you can simply use hour_counter__c + 1 in the formula). NOTE: Ensure that the Re-evaluate Workflow Rules after Field Change checkbox on the field update is selected.

6. Hit save, create new records, and test the values.


I hope you find the above information is helpful. If it does, please mark as Best Answer to help others too.

Thanks