0

Requirement: When New Lead is created with Course Type as online, phone no cannot be blank

The below validation rule which i tried.

AND(
ISNEW(ISPICKVAL(CourseType__c,'online'))),
ISNULL(Phone)

3 Answers 3

2
AND( ISNEW(),ISPICKVAL(CourseType__c,'online'),ISBLANK(Phone))
0
2

The ISNEW function does not take any parameters.

AND(
    ISNEW(),
    ISPICKVAL(CourseType__c, 'online'),
    ISNULL(Phone)
)
0

I think this one also works well.

Please use this formula:

IF(ISNEW() && Phone==null && ISPICKVAL(CourseType__c ,'online'),true, false)

As Adrian is saying we also need to add the ISNEW() in the formula to target new records only..so, I added the ISNEW() in the formula and it works fine.

3
  • You're not checking if it's a new record. You can also always replace IF(condition, true, false) with simply condition.
    – Adrian Larson
    Feb 26, 2017 at 18:53
  • You right Adrian, the ISNEW() needs to be part of the formula as well.. I updated my answer. Feb 26, 2017 at 19:03
  • It's still redundant.
    – Adrian Larson
    Feb 27, 2017 at 1:55

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .