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
Jing Jiang 1Jing Jiang 1 

How to date stamp in salesforce?

I have a work flow, whenever the stage move from New opp to anything but closed lost, their will be a date stamp. however, my workflow is change the time when created, and every time it’s edited. I need the date to be stamp not changing every time when people edit it.
How should I do that? It seems like the one I use PRIORVALUE is only supporting "created, and every time it’s edited" as the evaluation rule.

Here is my work flow: 
ISPICKVAL(PRIORVALUE( StageName ),"1. New Opportunity") && NOT(ISPICKVAL( StageName,"Closed Lost")) && NOT(ISPICKVAL( StageName,"Closed - Unqualified")) && NOT(ISPICKVAL( StageName,"1. New Opportunity"))&& NOT(ISPICKVAL( StageName,"2. Discovery Call"))&& NOT(ISPICKVAL( StageName,"Closed - Professional"))
Best Answer chosen by Jing Jiang 1
ShashForceShashForce
If you want the date field to be updated only once per record, considering the date field is blank before the first update, you can add the following to the end of the formula:

&&ISBLANK(date_field__c)

In case the date field is not blank before the first update, we need the help of another custom checkbox field, which can be hidden from the page layour and available only for the workflow field update. Add another field update to the same workflow rule to check the checkbox on the first fire. Add the following to the formula to ensure that the workflow rule fires only if the checkbox is unchecked:

&&checkbox_field__c

All Answers

ShashForceShashForce
Hi,

Please add the following at the end of your formula so that the workflow will triggger only if the stage value is changed:

&&ISCHANGED(StageName)

If this answers your question, please mark this as the Best Answer for this post, so that others can benefit from this post.

Thanks,
Shashank
Jing Jiang 1Jing Jiang 1
Thanks Shashank! However, this is not working the same way I want. I need the time to not be changed as long as the date field being updated once.
ShashForceShashForce
If you want the date field to be updated only once per record, considering the date field is blank before the first update, you can add the following to the end of the formula:

&&ISBLANK(date_field__c)

In case the date field is not blank before the first update, we need the help of another custom checkbox field, which can be hidden from the page layour and available only for the workflow field update. Add another field update to the same workflow rule to check the checkbox on the first fire. Add the following to the formula to ensure that the workflow rule fires only if the checkbox is unchecked:

&&checkbox_field__c
This was selected as the best answer
Jing Jiang 1Jing Jiang 1
Thanks so much Shashank! It works!