2 Replies Latest reply on Oct 31, 2018 7:48 AM by Dan Bontrager

    'Invalid year for DATEVALUE function' error help

    Dan Bontrager

      I am trying to modify a validation rule so only change requests created on or after 11/10/2018 will fire the validation if the other conditions apply (if 2 fields equal certain values).  This will help us with future DataLoader mass changes so they do not fail on this validation rule for records created before 11/10/2018.

       

      Old Validation Rule:

      TEXT(BMCServiceDesk__Change_Type__c) = "Standard(SOP)" &&

      ISBLANK(SOP_Name__c)

       

      Modified Validation Rule:

      TEXT(BMCServiceDesk__Change_Type__c) = "Standard(SOP)" &&

      ISBLANK(SOP_Name__c) &&

      (DATETIMEVALUE(CreatedDate) >= DATETIMEVALUE("2018–11–10 10:00:00Z"))

       

      Validation Rule Error Message: At least one SOP Name must be selected when Change Type is set to Standard(SOP).

       

       

      This is not returning any syntax errors and does save, but when I create a change request when the rule should not fire (i.e. Change Type = 'Standard(SOP)' & SOP Name is blank & the date is 10/30/2018) and click Save, I get this message were validation messages appear:

      Validation Formula "SOP_Name_is_required" Invalid (Invalid year for DATEVALUE function)

       

      I have tried a few variations of DATETIMEVALUE and DATEVALUE, but cannot get past this.  Can anyone help?  Thanks!