Hi All.
Today is a new issue and solution.
Issue: We were adding an item into a list using the JavaScript Object Model (JSOM). We have one field in the list of type UserMulti as in the following:
- <Field ID="{}"
- Name="Users"
- DisplayName="Users"
- Type="UserMulti"
- UserSelectionMode="PeopleOnly"
- Required="TRUE"
- Group="My Site Columns">
- </Field>
The following is the code snippet (sample code snippet) we must add to the item in the list:
- // Get the people picker object from the page.
- var peoplePickerUsers = SPClientPeoplePicker.SPClientPeoplePickerDict.peoplePickerDiv_TopSpan;
- // Get user keys.
- var keysUsers = peoplePickerUsers.GetAllUserKeys();
- var users = new Array();
- var selectedUsers = keysUsers.split(';');
- $.each(selectedUsers, function () {
- users.push(SP.FieldUserValue.fromUser(this));
- });
- var creationInfo = new SP.ListItemCreationInformation();
- var listItem = list.addItem(creationInfo);
- listItem.set_item("Title", “Title”);
- listItem.set_item("Description", “Description”);
- listItem.set_item("Users", users);
- listItem.update();
- context.load(listItem);
- context.executeQueryAsync(success, fail);
But when we were trying to add three users then we were getting the exception: “The user does not exist or is not unique…” with the following stack trace.

Solution:
This seems to be a strange issue since adding two users works but no more than two users.
After digging in more, I found that there is a property “Mult” that must be specified. According to MSDN:
Mult Optional Boolean. TRUE to allow a lookup field to contain multiple values. The default is FALSE.
So after setting this property the fields schema looks as:
- <Field ID="{}"
- Name="Users"
- DisplayName="Users"
- Type="UserMulti"
- UserSelectionMode="PeopleOnly"
- Required="TRUE"
- Group="My Site Columns"
- Mult="TRUE">
- </Field>
Thanks!
Feel free to provide any relevant comments / feedback / suggestions.

Sr KarthigaPosted Apr 3, 2016, 12:07 AM
good one
Sr KarthigaPosted Apr 3, 2016, 12:07 AM
nice explanation
Gowtham RajamanickamPosted Mar 11, 2015, 7:09 AM
good one..
Sibeesh VenuPosted Feb 25, 2015, 5:15 AM
Good one.
Prasham SabadraPosted Feb 25, 2015, 12:57 AM
Thanks!
Rahul Kumar SaxenaPosted Feb 24, 2015, 11:33 PM
Gud One bro...