function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Beto Carvalho 11Beto Carvalho 11 

Is it possible to use a formula FIELD to date stamp when picklist is set to "Value C"?

Any formula ninjas out there that can think of a way to do this?

Use Case:
  • PICKLIST__c has values:
    • "Value A"
    • "Value B"
    • "Value C"
    • "Value D"
  • Create a formula field (DATE format): DATE_STAMP__c.
  • When user sets PICKLIST__c to "Value C", enter date on DATE_STAMP__c
This is done simply with a workflow rule and field update, I know. This is more of a learning excercise.

The logic would have to be something like:

if PICKLIST__c is set to "Value C", set to TODAY, otherwise do nothing

Problem 1: I can't think of a logic that would determine PICKLIST__c has just been set to "Value C", since PRIORVALUE doesn't work in formula fields.

Problem2: I can't think of a way to "do nothing" (one way would be just to refer the field back to itself, PICKLIST__c, but you can't refer a formula field to itself).
Shashikant SharmaShashikant Sharma
Hi Beto,

This can not be achieved with Formual field as formula fields are calcualted at the time when it is fetched so if you use funciton TODAY() it is not going to return the date when picklist option was selected but it will give the Today's date.

So you are right that the way to achieve it that you create a Date Field and set it by Workflow Rule or Process Builder.

Thanks
Shashikant