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
HarryBHarryB 

Validation rule containing a 'multiselect picklist' field

Hi all,
 
I was just trying to set up a validation rule that uses a field of type 'multiselect picklist'. Unfortunately it is possible at all - the field is not available using the "add field" dialogue of the rule editor. To be exact, the list of all available fields is simply missing all names of  'multiselect picklist' fields.
 
Is this a bug or simply bad design?
 
Cheers,
Harry
MystiMysti
This is in the "Implementation Notes" for vailidation rules in the help topic "Validation Rule Considerations":

Validation formulas cannot reference merge fields for auto number, multi-select picklist, or compound address fields like Mailing Address. However, merge fields for individual address fields, such as Billing City, can be used in validation formulas.


HarryBHarryB

Alright, I "solved" the issue in the meantime by adding a workflow that sets/unsets a (hidden) checkbox according to a certain value of the multipicklist - and the checkbox can trigger a validation rule etc.

Cheers,

Harry

polkhwbpolkhwb
Harry, I've got a similar problem and so I'm very interested in your solution.
 
I'm wondering how this works, because normally the validation rules will be checked first and then all workflows will be performed. If this is true the change to the hidden checkbox is not noticed by the validation rule because actioned after the validation rule is checked.
 
Anything I'm doing/thinking wrong?
 
Thanks,
-Heinz. 
HarryBHarryB

Heinz,

both the validation rule and the workflow are being triggered after the parent record has been changed. So if the workflow sets the invisible checkbox, this means just another record change and the validation rule is fired (again).

Cheers,

Harry

P.S.: Your firstname sounds pretty german to me, or am I mistaken?

polkhwbpolkhwb

Harry,

I'm still struggling with the proposed solution. I've added the workflow that sets the (hidden) checkbox when the multiselect picklist is not empty. I've also added a validation rule that checks if the checkbox value is still false and then throws an error message. The validation rule also ANDs another condition which defines when the validation has to be performed.

Let's assume the multiselect picklist is empty and all conditions to perfom the validation rule are true. When I try to store the record the validation rule throws an error and the record remains in edit mode (which is correct). I then select an picklist item and try to store again: but the same error as before will be thrown.

My explanation to this: It is due to the sequence how SF handles the tasks. SF first checks the validation rules again. Because the workflow Update Field task has not yet been processed the checkbox status is still false and the validation fails. I need to cancel the edit mode to leave the loop.

What have you done different that it works for you?

Thanks again,

Heinz

BTW: Yes I'm German, living near Düsseldorf and working for an American company.

 

      

HarryBHarryB
Heinz,
 
duh, seems I forgot to mention one important detail:
You actually need two workflows, one setting the checkbox and another that unsets it again, according to the criteria/triggers of the multiselect. I guess in the moment you are just missing one workflow.
 
Sorry for being a bit unspecific here!
 
Cheers,
Harry
 
BTW: Hamburg here ;-) 
polkhwbpolkhwb
Hallo Harry und guten Tag
 
- Die Welt ist klein -
 
I had already implemented the two workflows which set respectivley re-set the checkbox.
 
Relying upon the construct works for you  ;-) I will invest some more time to check the third time how my workflows, rules and validation rules work together, possibly it's a small bit that has to be changed.
 
Will inform you about the result.
 
Grüße aus dem Rheinland,
Heinz.