Person Group type column not listed on a custom list's Validation Settings page
-
01-10-2020 - |
Вопрос
I have a Person Group type site column that I am using in a custom list through content types. On the Validation Settings page of the list I cannot find that column listed in the selection list of other columns. Therefore I cannot use it in the validation formula. I tried to type it in the formula and got an error.
One or more column references are not allowed, because the columns are defined as a data type that is not supported in formulas.
How can I use a Person Group type column in the validation?
Решение
Person & Group fields are complex fields. i.e they holds more information which you can treat as an object. Because of this these fields can't be used in a Formula (we can't specify which property of the object we should use (id/loginname/displayname/email)
Work around
- Create an event receiver and do the validation in
ItemAdding
- Create a workflow and extract information from the person field and put it into another field. Use this new field in the formula.