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
The Online 401kThe Online 401k 

Formula in Workflow Field Update

I'm trying to copy one custom date field to another when the first one is populated. I set up a workflow rule with a field update, but I'm not sure how to copy the date using a formula.  I tried using the DATE and DATEVALUE functions, but no luck.  

 

Is there a formula that will copy one custom date field to another? 

Best Answer chosen by Admin (Salesforce Developers) 
EnthEnth

If both fields are of type Date then you just put the second field in the formula and hey presto. However, I have had problems with Standard fields that say they're dates but expecting Text as the result. In these cases, oddly, try: TEXT(mycustomdate__c).

 

Can you be more specific about what fields you're trying to set and any error you're getting on Check Syntax ?

All Answers

EnthEnth

If both fields are of type Date then you just put the second field in the formula and hey presto. However, I have had problems with Standard fields that say they're dates but expecting Text as the result. In these cases, oddly, try: TEXT(mycustomdate__c).

 

Can you be more specific about what fields you're trying to set and any error you're getting on Check Syntax ?

This was selected as the best answer
The Online 401kThe Online 401k
That was it!  I kept trying to combine the field name with a function, but I never tried just the field name on its own.  Thanks so much!
communitycommunity

I have a lookup field .. when i click on the lookup icon and select one value from the list... the value gets into this field... I want the same field value to be auto filled in another field(text)..

 

I used just the field name in the formula... but it doesnt work :(

EnthEnth

Can you paste in the formula you've tried as it should be very straightforward?

 

For example, to add a formula field to an Opportunity that holds the Account name you'd just use:

 

 Account.Name 

 

I'd also question why you want to do this in the first place, unless you're appending some additional information? 

 

 

BTW, please note it's better to ask a new question in a new thread, you'll get more chance of a reply as a new thread than a comment on an existing one.