0

need to create a validation rule for record type to restrict the user from creating leads with 2 conditions, one when the email is blank and another when (screening pick value is unscreened and Territory Lookup is blank), following is something I tried but it works for first condition but not the second. 

AND( 
  $RecordType.Name = "Partner Record Type", 
  ISBLANK(Email),
  OR(
    $RecordType.Name = "Partner Record Type", 
    ISPICKVAL(Screening__c, "Unscreened"),
    ISBLANK(Sales_Territory__c)
  )
))

1 Answer 1

0

Try this:

AND(  
$RecordType.Name = "Partner Record Type",  
OR(ISBLANK(Email), AND(ISPICKVAL(Screening__c, "Unscreened"), ISBLANK(Sales_Territory__c)))
)

Edit:

OP, you are checking the conditions the second time, plus your second condition does not seem to be written the way you want it to work.

What the second condition does is return a TRUE even if one of the conditions:

$RecordType.Name = "Partner Record Type", 
ISPICKVAL(Screening__c, "Unscreened"),
ISBLANK(Sales_Territory__c)

is true, which is not the expectation. Also, you need not check record type in the second block.

The suggested block will :

  1. Check the record Type
  2. and Any of the following: a. Email field is BLANK OR b. Screening__c = 'Unscreened' AND Sales_Territory__c is BLANK.

which is the intended behaviour.

3
  • 1
    I've downvoted because this it doesn't contain any explanation. How is this different from what OP already has? Why should that difference cause this to work? The explanation is as important as the solution.
    – Derek F
    Jun 22, 2020 at 11:25
  • Downvote removed, thanks for adding an explanation!
    – Derek F
    Jun 22, 2020 at 13:08
  • Thanks for the explanation. It Worked !!
    – Venu M
    Jun 22, 2020 at 14:22

You must log in to answer this question.

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