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
chowdary marellachowdary marella 

formula

How to stamp a date in custom field . i have created a formula field    IF(  ISPICKVAL(Confirmed__c, 'yes') , today() ,'').

 

in picklist if yes is selected, today date should populate, when no is selected it should give no value.

 

Best Answer chosen by Admin (Salesforce Developers) 
Dipak NikamDipak Nikam

Try this, by creating a formula field which returns Date type

 

IF(  ISPICKVAL(Confirmed__c, 'yes') , today() , null)

All Answers

chowdary marellachowdary marella

Firstly i tried with workflow.created a pickist confirmed__c with yes,no.    and date fields as datestamp__c .

when yes is selected i have updated with     

Formula:: Value Today()

 

 

when yes is selected iam able to get the date of today. but when i update with NO ,,,, the same date is remains unchanged..

Shiv ShankarShiv Shankar
I think you did not select every time created and edited option during creation of work flow.
chowdary marellachowdary marella

I have selected every time created and edited only,,, but when NO is selected,date is not auto hidding

Dipak NikamDipak Nikam

Try this, by creating a formula field which returns Date type

 

IF(  ISPICKVAL(Confirmed__c, 'yes') , today() , null)

This was selected as the best answer
chowdary marellachowdary marella

given filter OR. so working 

davidjgriffdavidjgriff
You do realize that a formula field is calculated when accessed, right? So this field will ALWAYS show today's date for any object that has a Confirmed__c value of "yes".

If you want to actually record when that field changes to "Yes", then a workflow rule + field update is the way to go. If you need to remove the date if it changes back to "No" then it's a simple matter of another workflow rule + field update, just in reverse.