2

I am trying to write validation rule on task to make WhoId as required field. Tried following as Error Condition formula :

ISBLANK(WhoId)
ISNULL((WhoId)

After little research found that WhoId is a polymorphic field and this field cannot be used in salesforce validation rule formula.

Are there any workarounds for this or am I missing anything here? (I want to avoid writing code for this unless it is the last option)

1 Answer 1

3

You appear to have an extra opening parenthesis. This Validation Rule saves for me:

ISBLANK(WhoId)

Whereas the formula you provided gives a syntax error:

Error: Syntax error. Missing ')'


Here are some screenshots to prove it works in my org:

Rule

Validation Rule Detail

Error

You must specify a WhoId


PS - A word on the post you refer to from which you interpreted you cannot reference WhoId. You cannot reach through that relationship to get fields off the Who parent, but you can reference the WhoId field itself.

No Joy

Who.Name

Joy

WhoId
8
  • It gets saved but is not working as expected.
    – sf_user
    Commented Jan 23, 2017 at 20:34
  • @pmvsdt Hmm, it works perfectly for me. Did you make sure it's active?
    – Adrian Larson
    Commented Jan 23, 2017 at 20:35
  • I just rechecked and VR is active. when I edit an existing task associated to case, remove its WhoId (make the value of related contact null) and save, it is getting saved but as per this VR it shouldnt be saved.
    – sf_user
    Commented Jan 23, 2017 at 20:40
  • Again, this is my entire rule and it blocks insert and update when WhoId is not populated. Maybe you have some logic filling it in. Are you sure the value is actually null after the save succeeds?
    – Adrian Larson
    Commented Jan 23, 2017 at 20:43
  • Keeping that VR active, now edit your task, populate a contact and save, I believe u will still see that VR error message..
    – sf_user
    Commented Jan 23, 2017 at 20:45

You must log in to answer this question.

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