| Available in: Contact Manager, Group, Professional, Enterprise, Performance, Unlimited, Developer, and Database.com Editions |
For more information on any of the formula functions used
in these examples, see Formula Operators and Functions Overview.
Time Cards Must Total 40 Hours
| Description: |
Ensures that users cannot save a time card record with more
than 40 hours in a work week. This example requires five custom fields
on your custom object, one for each day of work. |
| Formula: |
|
| Error Message: |
Your total hours cannot exceed 40. |
| Error Location: |
Top of Page |
Number Cannot Be Negative
| Description: |
Validates that a custom field called Hours Worked is not a negative number. |
| Formula: |
|
| Error Message: |
Hours Worked cannot be less than zero. |
| Error Location: |
Hours Worked |
Number Must Be Even
| Description: |
Validates that a custom field called Ark Passengers is a non-negative even number. |
| Formula: |
|
| Error Message: |
Ark Passengers must be a positive even number. |
| Error Location: |
Ark Passengers |
Number Must Be Odd
| Description: |
Validates that a custom field called Socks Found is a non-negative odd number. |
| Formula: |
|
| Error Message: |
Socks Found must be an odd number. |
| Error Location: |
Socks Found |
Number Must Be a Multiple of Five
| Description: |
Validates that a custom field called Multiple of
5 is a multiple of five. |
| Formula: |
|
| Error Message: |
Number must be a multiple of five. |
| Error Location: |
Multiple of 5 |
Number Must Be an Integer
| Description: |
Validates that a custom field called My Integer is an integer. |
| Formula: |
|
| Error Message: |
This field must be an integer. |
| Error Location: |
My Integer |
Number Must Be Between -50 and 50
| Description: |
Validates that a custom field called Volume is between -50 and 50. |
| Formula: |
|
| Error Message: |
Volume must be between -50 and 50. |
| Error Location: |
Volume |
Number Range Validation
| Description: |
Validates that the range between two custom fields, Salary Min and Salary Max, is no
greater than $20,000. |
| Formula: |
|
| Error Message: |
Salary range must be within $20,000. Adjust the Salary Max
or Salary Min values. |
| Error Location: |
Salary Max |
Percentage Must Be Between Zero and 100
| Description: |
Validates that a custom field called Mix Pct is between 0 and 100%. Note that percent fields are expressed divided
by 100 in formulas (100% is expressed as 1; 50% is expressed as 0.5). |
| Formula: |
|
| Error Message: |
Mix Pct must be between 0 and 100%. |
| Error Location: |
Mix Pct |