When creating Validation Rules on Resource Hero objects, it is important to set your criteria so that rate and other calculations are not impacted.
For example, if you are trying to prevent time from being tracked when the Forecast Date is more than two weeks in the past, you might create a validation rule that looks like this:
The problem is that this validation rule will prevent updates when making changes to the Resource Rates table. To ensure that you can both update the Resource Rates table and prevent users from logging time more than two weeks in the past, you could modify your validation rule to the following:
This validation rule will do the following:
- Check if the date is more than two weeks in the past
- If the record is new, checks to see if the user has entered a value in Actuals
- If the record is not new, checks to see if the user is trying to change the Actuals
With this logic in place, Resource Rate updates on Resource Forecast records which are more than two weeks in the past will still be processed successfully since, during these operations, we are neither creating Resource Forecast records or changes the value of the Actual field.