Skip to main content

Did you know that effective Summer '14, you can access activity dates in formulas? For example, if you've ever wanted to ensure that users can't backdate a task due date more than three days, you could write the following validation rule:

ActivityDate < TODAY() - 3

You can also access the event start date/time, but there's a trick: if it's an all-day event, you use the ActivityDate field, but if it's got a date and time, you need the ActivityDateTime field. So a similar validation rule on events looks like this:

IF(

IsAllDayEvent,

ActivityDate < TODAY() - 3,

DATEVALUE(ActivityDateTime) < TODAY() - 3

)

Pretty spiffy!

@Salesforce.org System Administrators
댓글 2개
  1. 2014년 8월 27일 오후 4:37
    Saw that come in Summer and had not figured out the import...thanks for posting!
0/9000