Take the 2-minute tour ×
Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It's 100% free, no registration required.

We have a requirement that need to display the date&time when user select as 'Completed' from a Status picklist filed.I used below formula to achieve this.It is working exactly perfect in the object .But when I used this field in the Report,fetching the Report creation date in that field.

IF( ( ISPICKVAL( Status , "Completed" ) ) , NOW() , null )

Please help to resolve this issue.

share|improve this question
1  
I don't think is very clear what is the issue when you run the report, could you rephrase it or post a screenshot?. Also, are you sure you want to use a formula to display the value of now if the status is completed and not to actually store the value of NOW at the moment the record was set to completed (using a field update) ? –  PepeFloyd Jul 16 at 7:56
add comment

1 Answer 1

up vote 5 down vote accepted

Formula fields don't execute the formula once and save a value, they are evaluated each time that the record is retrieved from the database - in this case the records are retrieved from the database when the report is run, so now() is re-evaluated at that time.

If you want to timestamp when the status field changed to that value, you should use a workflow rule and apply that formula to a workflow field update triggered by the rule. That will evaluate the formula and update the field at the time the change took place.

share|improve this answer
    
Thanks Bob,I've changed the criteria as you suggested and its working fine. –  RajSfdc Jul 16 at 17:53
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.