| 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.
Date Must Be a Weekday
| Description: |
Validates that the value of a custom date field is a weekday
(not Saturday or Sunday). |
| Formula:
|
|
| Error Message:
|
Date must be a weekday. |
| Error Location:
|
My Date |
Date Must Be a Weekend Day
|
Description: |
Validates that the value of a custom date field is a Saturday
or Sunday. |
| Formula: |
|
| Error Message: |
Date must be a weekend day. |
| Error Location: |
My Date |
Date Must Be in the Current Month
|
Description: |
Validates that a custom date field contains a date within the
current month and year. |
| Formula: |
|
| Error Message: |
Date must be in the current month. |
| Error Location: |
My Date |
Date Must Be in the Current Year
|
Description: |
Validates that a custom date field contains a date within the
current year. |
| Formula: |
YEAR( My_Date__c ) <> YEAR
( TODAY() ) |
| Error Message: |
Date must be in the current year. |
| Error Location: |
My Date |
Date Must Be the Last Day of the Month
|
Description: |
Validates whether a custom field called My Date is the last day of the month. To do this, it determines the date
of the first day of the next month and then subtracts 1 day. It includes
special case logic for December. |
| Formula: |
|
| Error Message: |
Date must be the last day of the month. |
| Error Location: |
My Date |
Date Must Be Within One Year of Today
|
Description: |
Validates whether a custom field called Follow-Up
Date is within one year of today’s date. This example
assumes a 365 day year. (It does not handle leap years.) |
| Formula: |
|
| Error Message: |
Follow-Up Date must be within one year of today. |
| Error Location: |
Follow-Up Date |
Day of Month Cannot Be Greater Than 15
|
Description: |
Validates that a custom field called Begin Date contains a date in the first 15 days of the specified month. |
| Formula: |
|
| Error Message: |
Begin Date cannot be after the 15th day of month. |
| Error Location: |
Begin Date |
End Date Cannot Be Before Begin Date
|
Description: |
Validates that a custom field called End Date does not come before another custom field called Begin
Date. |
| Formula: |
|
| Error Message: |
End Date cannot be before Begin Date. |
| Error Location: |
Begin Date |
Expiration Date Cannot Be Before Close Date
|
Description: |
Validates that a custom field called Expiration Date does not come before Close Date. |
| Formula: |
|
| Error Message: |
Expiration Date cannot be before Close Date. |
| Error Location: |
Expiration Date |