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
Leah MorganLeah Morgan 

Auto Fill Case Complete Time

Hello,

I'm trying to set up a simple formula for my org that will autopopulate the case complete time when it is switched into a completed or closed status, otherwise it will put N/A in the field.  If the case is switched from completed to closed, I don't want it to update again, but if it's switched from any other value, to completed or closed, I want it to overwrite the 'N/A' and put in the closed/completed time.  

This is what I have so far, (I could be way off...) but the formula editor is giving me an error, would anyone be willing to take a look at it and let me know what I did wrong?  Thank you! 
If (AND((ISPICKVAL(Status = "Complete")||(ISPICKVAL(Status = "Closed"), ISBLANK(Complete_Date_Time) || (Complete_Date_Time = "N/A"), NOW(),
 BLANKVALUE(Complete_Date_Time, "N/A"))

 
Best Answer chosen by Leah Morgan
Leah MorganLeah Morgan
I figured it out using a workflow rule.  I'm not sure why it wouldn't just let me write a formula, but this is what I wound up doing:
 
((Case: StatusEQUALSComplete) OR (Case: StatusEQUALSClosed)) AND ((Case: Complete Date/TimeEQUALSnull))

 

All Answers

GauravGargGauravGarg
Hi Leah,

Please try below formula. 
If (
	OR(ISPICKVAL(Status = 'Complete'),ISPICKVAL(Status = 'Closed')), 
	NOW(),
	'N/A'
)

Hope this will solve your problem, let me know if you still face issues in this. 

Thanks,
Gaurav
Email: gauravgarg.nmim@gmail.com
Leah MorganLeah Morgan
Thank you!  the formula is telling me that 'status; cannot be used in this formula, that is the name of the picklist that I want the formula to reference though
Rajan Patel 8Rajan Patel 8
Try this..

If (
      OR(
          ISPICKVAL(Status, 'Complete'),
          ISPICKVAL(Status, 'Closed')
         ), 
    TEXT(NOW()),
    "N/A"
    )
GauravGargGauravGarg
Hi Leah,

Please try this:
 
If (
	OR(ISPICKVAL(Status, 'Completed') ,ISPICKVAL(Status, 'Closed') ), 
	Text(NOW()),
	'N/A'
)

Let me know if you still face issues on this.

Thanks,
Gaurav
Leah MorganLeah Morgan
It's still giving me this error with both of the above formulas: 'Error: Field Status may not be used in this type of formula'
Leah MorganLeah Morgan
I rewrote my formula that I had been working on earlier to try and make it make more sense, and with this one now too, it is telling me that the status field cannot be used.  Could it be that I'm referencing the name of the picklist wrong?
 
If (AND(OR(IsPickval (Status = 'Complete'), IsPickval (Status = 'Closed')),
	OR (ISBLANK (Complete_Date_Time), (Complete_Date_Time = 'N/A')),
	NOW (), BlankValue (Complete_Date_Time, 'N/A')
	))

 
Leah MorganLeah Morgan
I figured it out using a workflow rule.  I'm not sure why it wouldn't just let me write a formula, but this is what I wound up doing:
 
((Case: StatusEQUALSComplete) OR (Case: StatusEQUALSClosed)) AND ((Case: Complete Date/TimeEQUALSnull))

 
This was selected as the best answer
Rajan Patel 8Rajan Patel 8
Make sure that you used ISPICKVAL(Status, 'Complete') instead of IsPickval (Status = 'Complete'). Also, the formula field typ needs to be set to 'Text'
Leah MorganLeah Morgan
Thank you! :)