function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Laura GilLaura Gil 

Combination of Case validation rules doesn't work

I am trying to run a pair of vaildations rules, but they are not working good.
Here the requirements first (object Case):
Case Subtype should be filled if Case Status is either 'On Hold', 'Escalated' or (Case Status = 'Assigned' and Case Substatus = 'Assigned-Support')
Work-Size should be filled if Case Subtype is filled
All these are picklists.
The Case Substatus field is based on a picklist value set of the same name.

These are my validation rules:

1. Empty_Case_Type:
 
IF(OR(ISPICKVAL(Status, 'On Hold'),
ISPICKVAL(Status, 'Escalated'),
AND(ISPICKVAL(Status, 'Assigned'),ISPICKVAL(SubStatus__c, 'Assigned - Support'))),
true, false)
2. Empty_Work_Size:
 
IF(NOT(ISBLANK(TEXT(CaseType__c))),
true, false)
Unfortunately the combination is not working.
If I have already a value in the field Case Type and I choose Status=Assigned and Substatus='Assigned-Support' the validation rule is still asking me for selecting a value in the field Case Type OR

If I have already a value in both fields Case Type and Work Size and I choose Status= Assigned and Substatus='Assigned-Support' the validation rule still asks for selecting a value in the field Case Type.

No idea what can be wrong in my validation rules.
I would appreciate any advice.

 
Maharajan CMaharajan C
Hi Laura,

Try the below changes in validation rule:

1. 
​​​​
AND(
OR(ISPICKVAL(Status, 'On Hold'),
ISPICKVAL(Status, 'Escalated'),
AND(ISPICKVAL(Status, 'Assigned'),ISPICKVAL(SubStatus__c, 'Assigned - Support'))),
ISBLANK(TEXT(CaseType__c)
)
2.
AND(
ISBLANK(TEXT(WorkSize__c),
NOT(ISBLANK(TEXT(CaseType__c)))
)

Thanks,
Maharajan.C
Maharajan CMaharajan C
Or try the single one:
 
AND(
OR(ISPICKVAL(Status, 'On Hold'),
ISPICKVAL(Status, 'Escalated'),
AND(ISPICKVAL(Status, 'Assigned'),ISPICKVAL(SubStatus__c, 'Assigned - Support'))),
OR(ISBLANK(TEXT(CaseType__c), ISBLANK(TEXT(WorkSize__c))))
)

Thanks.
Maharajan.C
Laura GilLaura Gil
Thanks Maharajan for responding. An additional point I see: If I use the second approach, I don't see any possibility to let the warning appear that either or the other field has to be set (Case Type or Work Size). You can only select one field at a time in the validation rule in order to let the warning appear either on the top or below the field which has to be set.