Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I came across this post showing how to create a permissions management webPart using SPServices. I tried to do it in SP2010 but keep getting error " User not found". I think it has something to do with the "userLoginName", I'm not sure how to alter it.

This is the part of the code causing the error:

  //Populate the Groups Assigned
  $().SPServices({
      operation: "GetGroupCollectionFromUser",
      userLoginName: $("#my_SiteUsers").attr("value"),
      async: false,
      completefunc: function(xData, Status) {
        $(xData.responseXML).find("errorstring").each(function() {
          alert("User not found");
          booErr = "true";
          return;
        });
        $(xData.responseXML).find("Group").each(function() {
          strHTMLAvailable += "<option value='" + $(this).attr("Name") + "'>" + $(this).attr("Name") + "</option>";
          arrOptionsAssigned[intOpts] = $(this).attr("Name");
          intOpts = intOpts + 1;
        });
        $("#my_SPGroupsAssigned").append(strHTMLAvailable);
      }
  });
share|improve this question
    
Can you post what the value ofvb$("#my_SiteUsers").attr("value")b looks like? It may be an escaping thing, depending on your auth method. It could also be due to your permissions. –  Marc D Anderson Oct 11 '13 at 15:38
    
Hi Mark, this is an old question. I don't know why but I found that passing a variable as the userLoginName worked for me. Plus it makes reuse a bit easier. Thanks for the reply. –  Batman Oct 11 '13 at 19:46

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.