A Beginners Guide to Date Stamping in Salesforce

Date stamping can be used in Salesforce to record the date or date/time when a particular field is changed. This is used frequently for capturing the date the lead entered a particular stage or when a lead was first actioned. These fields can be used in reports and dashboards. Let’s dive into how to set this up and some example use cases.

The basics

The best way to date stamp in Salesforce is to create a workflow rule to update the field.

  1. Create the date field

    The first step is to create the field on the object. You can choose either the date field type or the date/time field type.
  2. Create the workflow rule

    Create a new workflow rule (Setup > Proceess Automation > Workflow Rules > New Rule). Select the object you where you just created the field and add the rule criteria.
  3. Add a workflow action to update the field

    Create a workflow action to update the date field. Use a formula field to set the value. If your field type is DATE/TIME use NOW() as your formula. If the field type is DATE use TODAY() as your formula.

Examples

Date stamp a field when a checkbox is checked

Create a workflow rule and select “created, and any time it’s edited to subsequently meet criteria” for your evaluation criteria. Next, add the filters for your rule criteria. In this example, I’m going to date stamp a field when the checkbox for “MQL is Accepted” is checked.

Add a workflow action to update your date field. Select “Use a formula to set the new value”. Your formula should be set to TODAY() unless your field is a DATE/TIME field. In that case, it should be set to NOW().

Now all you need to do is activate your workflow rule and test! Here’s what my completed workflow rule looks like.

Date stamp a field when a picklist value is updated

Create a workflow rule and select “created, and every time it’s editeda” for your evaluation criteria. Select run this workflow if the formula evaluates to TRUE and add your formula. In this example, I want to date stamp my field when the Stage for the lead is updated to Recycle, so my formula looks like this ISChanged(Status) && ISPICKVAL(Status,’Recycle’).

Add a workflow action to update your date field. Select “Use a formula to set the new value”. Your formula should be set to TODAY() unless your field is a DATE/TIME field. In that case, it should be set to NOW().

Now all you need to do is activate your workflow rule and test! Here’s what my completed workflow rule looks like.

Only date stamp the field if the field is currently empty

If you want to date stamp the date field ONLY if it’s currently empty, you can modify the formula in your workflow action.

IF(ISBLANK(My_Date_Field__c), TODAY(), My_Date_Field__c )

 



Bonus tip: Calculate the number of days between dates

Now that you are a date stamping pro, you can create formula fields to calculate the number of days between dates. These fields can be used in reports to show how many days a lead was in a particular stage, or how long it took sales to action the lead. Here’s an example of what a formula field looks like to calculate the number of days between when the lead was created and the MQL date:

MQL_Date__c – CreatedDate

Questions?

Send me a tweet @jennamolby, leave a comment below, or book a Peer Chat.