Great question, all you need to do is convert $Duration to a number. You can do this by dividing by 1 days. For example ($Duration / Days(1)) > 3 should work.
Post
FollowIs there a way to do a validation rule on $Duration
I would like to run a validation rule on the value of the $Duration field in timesheets. when i try to use the "=" or ">" or "<>" operators, it tells me that $Duration is not numeric, and is incompatible with those operators. how can i compare $Duration with a value so i can take different actions based on the value of the $Duration field
Please sign in to leave a comment.
2 comments
Date
Votes
As I face hard time to do my Validation rule and just receive the information to configure it properly, here the formula I used and how it is working, so you can customize it regarding your needs.
- $C_CustomField > hours(8)
- $Duration > hours(8)
- $C_CustomField >Days(1)
- $Duration > Days(1)
Or
- $C_CustomField > hours(12)
- $Duration > hours(12)
- $C_CustomField >Days(1.5)
- $Duration > Days(1.5)
The important part is to use the right Operator and then no need to divide but use the right time criteria following with how many you want to use as a limit.
Be care full that Days is not equal to 24h but to you working hours you set up in your organisation (in our configuration 1 days = 8 hours)
I hope it will help you, take care.