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

New Post: GetUserProfileByName returns user cannot be Found error

$
0
0

Hi Marc,

Thank you very much for your reply.

I used 'GetUserProfileByName' method to get the user profile information of any given user.

It is working well for the current user, but if I user any other user name, it is not returning any values.

 

The following is the code.

var PPValue = "Domain\\anyusername";

 $().SPServices({
                operation: 'GetUserProfileByName',
                AccountName:PPValue ,                               
                async: true,
                completefunc: function (xData, Status)
                {                               
                    var properties = xData.responseXML.getElementsByTagName('PropertyData'); 
                                     
                   
                   var propertyValues = new Array(); 
                  alert(properties.length);
                    for (var i=0; i < properties.length; i++) 
                    { 
                       var propName = properties[i].getElementsByTagName('Name')[0].childNodes[0].nodeValue;                                       
                       propertyValues[propName] = properties[i].getElementsByTagName('Value'); 
                      
                       var oValueNode = properties[i].getElementsByTagName('Value'); 
                        
                       if(oValueNode.length > 0)
                       {
                            propertyValues[propName] = oValueNode[0].childNodes[0].nodeValue;
                         
                       }
                       else
                       {
                            propertyValues[propName] = '';
                       }                                          
                    }     
                                     $().SPFindPeoplePicker({   
                      peoplePickerDisplayName: "Manager",
                      valueToSet: propertyValues["Manager"],
                      checkNames: true
                    });
                }
                          
              });

 

Thank you for your help in fixing this error.

Thanks,

Maria


Viewing all articles
Browse latest Browse all 6517

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>