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
gailhgailh 

Date Time formula

I need to set up a rule where an email is triggered at 3pm PST today if a case was created before 9am today or tomorrow at 3pm tomorrow if the case was created after 9am.

 

I've been trying a few things. The latest idea is to use a workflow rule to set the "SLA Deadline" date/time field upon case creation. Here's what I tried:

 

if(VALUE(MID ( TEXT(CreatedDate), 12, 2)) < 17,
SUBSTITUTE(TEXT(CreatedDate), MID(TEXT(CreatedDate), 12, 2), '23'),
NOW())

 

(note: NOW() was just a stub I was using until I figured out the first part). The idea was to take the time portion of the field and replace it with 3 pm.

 

so, the issue I'm having is that the second line (SUBSTITUTE) isn't a Date/Time value. I've tried using "DATEVALUE" before this line but that converts it to Date, not Date/Time.

 

Any ideas how I can construct a date/time field using a formula? Or ideas on how I can do this a different way?

sandeep@Salesforcesandeep@Salesforce
SFDC supports return type of formula to Date/Time.so you can construct it but it is not possible to get it from text on run time in formula.

Thanks 
Sandeep Singhal
http://www.codespokes.com/