0

HOW TO write a formula in workflow so that whenever status is in open/reopen state populate the custom field to today's date and if the status changes the the field should be null

IF(AND(
if(status = open/reopen/ then customfield = todays date)
 else
 {
  NULL
 }

2 Answers 2

0

You can use this also : -

IF(
  OR(   
  ISPICKVAL(status,"Open"), 
  ISPICKVAL(status,"reopen")), 
  TODAY(),
 ''
)
0

In the Workflow field update, choose the Custom field and put the formula in the editor.

IF(
  ISPICKVAL(status,"Open") 
  || ISPICKVAL(status,"reopen"), 
  TEXT(TODAY()),
 ""
)

It will return 2017-04-25.

If you want to return 4/25/2017 (mm/dd/yyyy) format use this:

IF(ISPICKVAL(Status,"Open") || ISPICKVAL(Status,"reopen"), 
     TEXT(MONTH(TODAY())) & "/" + TEXT(DAY(TODAY())) & "/" & TEXT(YEAR(TODAY()))
,"")

Note: it has been assumed, custom field is text field.

3
  • I have a datetime field CaseStatus__c to be updated ..... but i am getting Error: Incorrect parameter type for function 'IF()'. Expected Date, received Text ERROR....inside the formula field update.....
    – Kiran
    Commented Apr 26, 2017 at 5:15
  • updated the formula Commented Apr 26, 2017 at 5:16
  • @Kiran Santanu meant NULL instead of "", I presume.
    – sfdcfox
    Commented Apr 26, 2017 at 5:16

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .