Blocking Time Tracking on Select Days of the Week
Here's how to create rules that stop time-tracking entries on certain days. By setting up validation rules, you can ensure that time changes adhere to company policies, labor laws, and regulatory requirements. This feature can also act as a safeguard against human errors. Let’s have a look at how it works.
Accessing Validation Rules
- In your Salesforce app, navigate to the Setup menu by clicking on the cog icon in the upper-right corner.
- Next, in the left-hand panel, under Platform Tools, select Object Manager in the Object and Fields drop-down menu.
Setting Up Validation Rules for Time Tracking
- In the Object Manager, locate and click on the Time Entry object. You can use the Quick Find search box.
- Scroll down the left panel and click on Validation Rules.
- Next click New. To set your new validation rule to prevent time tracking on a certain day, you will need a formula. The formula is: WEEKDAY( DATEVALUE (flairStart_Datetimec)) = 6
- Formula explained: The number at the end of the formula represents the day of the week, starting with Sunday as 1 and incrementing for each subsequent day. For example, Friday is the sixth day of the week, so this formula above and below prevents time tracking on Fridays.
- To customize the error message that appears when the rule is violated, you can input your message into the Error Message text box. In this case, the error message will appear on the Employee Hub if staff members attempt to time track on a prohibited day.
Preventing Time Entry Changes on Designated Days
- To prevent users from manually making changes to their time entries i.e. using Add time entry on the Employee Hub, you'll need to set up a validation rule for the Time Entry Change Request object.
Configuring Validation Rules for Time Entry Change Requests
- This time in the Object Manager, locate and click on the Time Entry Change Request object
- Like in the other time tracking rule explained above, click on Validation Rules in the left panel
- Click New to create a validation rule about Add Time Entry on the Employee Hub
- Utilize the same formula as in the previous validation rule, which prevents time entry changes on a specified day. Remember the digit on the end of the formula represents the day of the week, with Sunday starting at 1: WEEKDAY( DATEVALUE (flairStart_Datetimec)) = 6
You have now successfully set up validation rules to block time tracking and prevent time entry changes on specific days of the week.
Updated about 1 year ago