3

My list uses a custom content type with a title, description and an assignedto-field that enables my user to select more than 1 person. However, I would like to limit the selected persons to a maximum of two.

As I'm a complete newbie in Sharepoint, how would I tackle this? InfoPath doesn't allow me to add validation on MultiUserType.

  • 1
    How about having a "Primary Assigned To" and "Secondary Assigned To" fields both as single user? – Ryan May 8 '12 at 10:42
3

In this situation, I would simply create a second field of type "Person or group", and disable multiple values for both of them. This is the most simple solution, however I realize that it is not very convenient, because in some scenarious user will have to do additional actions.

What about the custom validation, where are several ways to achieve this. First that pops in mind, is to open SharePoint Designer, customize form and add an ASP.Net validator there. This approach is described in the following codeproject article:

Also it is possible to use rendering template approach. It is more programmatic and involves creating a Visual Studio solution. This approach is explained in the following blog post:

2

I sometimes add script-based validation to the default forms for stuff like this. It's a bit less obtrusive than the custom validator or rendering template approach, and certainly less involved. Of course, it all depends on your skill set and governance rules on development.

I recently did a blog post on working with the People Picker that may give you some ideas. (The function is still a work in progress.)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.