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
lil_rangerlil_ranger 

Help with date in formula

I can't seem to get this date function to work.  I need the survey date to be null or to not be anything within 30 days

 

AND( 
NOT(CONTAINS(Contact.Email, 'yahoo.com')), 
Contact.Do_Not_Survey__c = false, 
ISPICKVAL(Status, 'Resolved'), 
CONTAINS($UserRole.Name, 'Tech'), 
$RecordType.Name = 'Support Ticket', 
AND( 
OR( 
ISNULL(Survey_Date__c), 
NOT(Survey_Date__c < TODAY () + 30) 
)))

 Any help would be greatly appreciated.  Thanks!

phiberoptikphiberoptik

Try using ISBLANK() instead of ISNULL()

lil_rangerlil_ranger

It's working with the blank date field, but when I put a date in there that is more than 30 days it's not working.  

phiberoptikphiberoptik

So the survey date has to be blank or not within 30 days of TODAY? So it always needs to be at least 30 days out or no date at all? I am not sure I understand that logic, but try this:

AND( 
    NOT(CONTAINS(Contact.Email, 'yahoo.com')), 
    Contact.Do_Not_Survey__c = false, 
    ISPICKVAL(Status, 'Resolved'), 
    CONTAINS($UserRole.Name, 'Tech'), 
    $RecordType.Name = 'Support Ticket', 
    OR( 
       ISBLANK(Survey_Date__c), 
       NOT(Survey_Date__c < (TODAY () + 30)) 
       )
)

 

lil_rangerlil_ranger

I have an email survey that should go out to the contact if the survey date field is blank or if they haven't been surveyed in the last 30 days.  I hope that clarifies my question.

phiberoptikphiberoptik

So did it work?

lil_rangerlil_ranger

No.  I put a test date in there of July 2012, which is more than 30 days, but I didn't recieve the email as intended.  I'll keep playing around with it.  

phiberoptikphiberoptik

And you are 100% certain that every other requirement in that formula is met? That is a lot of criteria to match up in order for the email to be sent.

 

What is your Evaluation Criteria on the workflow rule? (btw in the future make sure to disclose that this formula is for a workflow rule, as it changes the thought process when troubleshooting).