0

I'm trying to add a validation rule for a custom field(Service_Date__c) in Case object. If a Service_Date__c > today(), then error message should be displayed as :

Service Date should be greater than today

But the rule should fire only for new records. I tried like this :

ISNEW(Service_Date__c > today())

Error: Incorrect number of parameters for function 'isnew()'. Expected 0, received 1.

What am i missing? How to do this?

2

Try this,

ISNEW() && Service_Date__c <= today()

IsNew doesn't neeed any parameter. It returns true for insert and false for rest.

  • the following code ISNEW() && Service_Date__c >today(), not throwing any error. But when i create a new Case record, the validation rule not getting fired. – user42000 Apr 6 '17 at 12:46
  • 1
    @user42000 - I modified the answer to reflect that the Service_Date__c should be greater than today. So it will fire if new and service date is < or = today – Eric Apr 6 '17 at 12:49
  • You need less than today or greater than today. – wAitIng dOg Apr 6 '17 at 12:49
  • Service Date should not be less than today – user42000 Apr 6 '17 at 12:50
  • @Eric have changed it now. Use the modified rule. It will work. – wAitIng dOg Apr 6 '17 at 12:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.