A Beginners Guide to Date Stamping in Salesforce

A Beginners Guide to Date Stamping in Salesforce

min. reading

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.

Date stamp a field when a checkbox 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().

Use a formula to set the new value

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

completed workflow rule
Flow test

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’).

Date stamp a field when a picklist value is updated

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.

completed workflow

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 )

Only date stamp the field if the field is currently empty

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, or contact the Sercante team for help.

Subscribe to The Spot

Hidden
Hidden
Hidden
Hidden
This field is for validation purposes and should be left unchanged.

Upcoming Salesforce Events

Salesforce Training Courses

Categories

Top 5 Recent Posts

  • Jenna is a Marketing Operations leader with over 10 years of experience working with both enterprise organizations and start-ups. She started her career as a consultant, helping B2B and B2C clients get the most out of Marketo, Pardot, Marketing Cloud and Salesforce. She then moved in-house, working with B2B SaaS companies, helping them build their sales and marketing technology stacks and processes from scratch.

Leave Your Comment

Related Articles

Bot Single Post