Quantcast
Channel: jQuery Library for SharePoint Web Services
Viewing all articles
Browse latest Browse all 6517

Commented Unassigned: SPFindPeoplePicker max length at one time [10210]

$
0
0
Hello,

I would just like to say this is a great tool! There is just this one issue I have found.
Basically, I query the UserInfo list to get all the employees under X manager. Then I put each user name into a semi-colon separated string for use of the SPFindPeoplePicker function (valueToSet). The issue is that if the string is longer than 256 characters, an alert pops up saying the 'item length cannot be longer than 256 characters' and will not do the checkNames part of the function. I was wondering if it is possible to update this. I would like to see a way to append to the field rather than clearing it, or have the function handle the 256 character length issue internally.

Note: This is for Sharepoint 2010

Here is the code I am using that the error occurs
```
var userList = ""
$().SPServices({
operation: "GetListItems",
async: false,
listName: "UserInfo",
CAMLViewFields: "<ViewFields><FieldRef Name='Title' /></ViewFields>",
CAMLQuery: "<Query><Where><Or><Eq><FieldRef Name='Supervisor'/><Value Type='Text'>" + managerName + "</Value></Eq><Eq><FieldRef Name='Title'/><Value Type='Text'>" + managerName + "</Value></Eq></Or></Where></Query>",

completefunc: function (xData, Status) {
$(xData.responseXML).SPFilterNode("z:row").each(function() {
user = $(this).attr("ows_Title");
userList = userList + user + ";";

});
}
});
//add users to field
//currently, if userList > 256 chars, alert, does not checkNames
$().SPServices.SPFindPeoplePicker({
peoplePickerDisplayName: "Employees",
valueToSet: userList,
checkNames: true
});
```
Comments: With the workaround, this really isn't that big of a deal, but thank you for looking into this when more pressing matters are resolved.

Viewing all articles
Browse latest Browse all 6517

Trending Articles