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
Pablo ArgentinaPablo Argentina 

Autofill Date Field

Hi guys. Another easy question that it's makeing me go crazy!!!

 

I have 2 fields.

1.- Pick list with 3 different values (Win, Lost, 50%)

2.- Date field

 

I want to fill in (automatically) the DATE field with the exact day that i choosed WIN as the pick list value.

The idea is to remember when was that lead won and store that date under DATE field.

 

Any idea??

 

thanks in advance

Pablo (Argentina)

Best Answer chosen by Admin (Salesforce Developers) 
goabhigogoabhigo

'apai' that workflow will be fired everytime the record is edited and the picklist value is Win. Hence will keep on updating the date(you wont get the exact date when it was changed to win).

 

Pablo do this:

  • Change the Rule Criteria to 'formula evaluates to true'
  • Try this: ( ISNEW() && ISPICKVAL(Stage__c, 'Won') ) || ( ISCHANGED(Stage__c) && ISPICKVAL(Stage__c, 'Won') )
  • Save & Next
  • In the field update, update the date field(set the value as TODAY()).
Hope it helps.

All Answers

apaiapai

You can  create a workflow rule:

criteria -  whenever an opportunity record is created or edited, and did not previously meet the rule criteria

rule - when opp stage equals WIN

 

add workflow action - field update - 

select date field and using the formula editor, set the value as  TODAY()

 

 

goabhigogoabhigo

'apai' that workflow will be fired everytime the record is edited and the picklist value is Win. Hence will keep on updating the date(you wont get the exact date when it was changed to win).

 

Pablo do this:

  • Change the Rule Criteria to 'formula evaluates to true'
  • Try this: ( ISNEW() && ISPICKVAL(Stage__c, 'Won') ) || ( ISCHANGED(Stage__c) && ISPICKVAL(Stage__c, 'Won') )
  • Save & Next
  • In the field update, update the date field(set the value as TODAY()).
Hope it helps.
This was selected as the best answer
petec@i2isyspetec@i2isys

abhi, i have a similar problem.   I'm trying to create a workflow that would change the case status automatically to 'New' when a case is transferred to another person. But I don't want it to run for one particular case owner.

 

So I had: (ISCHANGED(OwnerId) as my formula to evaluate to true and that worked fine.  But now I want to be able to add, but if a particular user or role, then not have the formula evaluate to true and so not trigger the work flow.

 

I tried AND(ISCHANGED(OwnerId), OwnerId <> [a unique ownerid] but it didn't work.

 

Any suggestions would be appreciated.

 

Thanks.

goabhigogoabhigo

What is the unique ID in your case? Is it a field or is it the user ID appered on the address bar when clicked on that user?

AND(ISCHANGED(OwnerId), OwnerId <> 'owner id')

 

*the user ID appered on the address bar when clicked on that user[Your Name | Setup | Manage Users | Users | ]. Similar to this 005A0000001cbIr

petec@i2isyspetec@i2isys

It was the user id when I clicked on the users name under Users.  

However, I see now that you have a quote mark around the ownerid.  I did not have that and now it works!

Thanks so much for your help!  I really appreciate it.

 

Steve :-/Steve :-/

In a WFR you have the option of triggering "When a record is created, or when a record is edited and did not previously meet the rule criteria" that will prevent the date field from being updated every time the record is editied.