Example UpdateUserInfo

Aug 24, 2011 at 7:09 PM

Can someone please provide an example of the syntax for the UpdateUserInfo service.

Thanks!

Aug 24, 2011 at 7:32 PM
Edited Aug 24, 2011 at 7:33 PM

This link should help you along.   This url can also be found in the documentation on this site:

http://msdn.microsoft.com/en-us/library/ms772614(v=office.12).aspx

Doc Link:

http://spservices.codeplex.com/wikipage?title=Users%20and%20Groups&referringTitle=%24%28%29.SPServices

 

The syntax should look something like this:

$().SPServices({

operation: "UpdateUserInfo",

userLoginName: "domain\\userName",

userName: "User Name",

userEmail: "userName@example.com",

userNotes: "This should be a string, but I may be wrong",

completefunc: function(xData, Status) {

//do something cool

}

});

This hasn't been tested, I just typed it up.  You may need to change it to suit your needs or for it to even work.

Aug 24, 2011 at 9:30 PM

this worked great!! thanks,

Aug 25, 2011 at 1:29 AM
Edited Aug 25, 2011 at 1:29 AM

Glad to hear it worked ttrilling... Now I'd like to tell you how I got that answer, even though I've never used that operation.

Marc has done an amazing job of documenting all of the Web Services.  Not only that, he's done a better job at wrapping all of those Web Services in a real easy way to use.  So, when I need to use a new operation, I like to go to this page:

http://spservices.codeplex.com/wikipage?title=$().SPServices&referringTitle=Documentation

From here, I click on the category that makes the most sense.  For your question: Users and Groups; is a good guess.  Within that link, you'll find all of the methods that are contained within this section.  Within the table of information, you'll see 4 headers: Operation, Options, MSDN Docs, Introduced (Version #).  I found the operation I needed (because you gave it to me :P), then found all of the options that are needed for this SPServices call: userLoginName, userName, userEmail, userNotes.  If I'm not mistaken, the options that are in [brackets] are *not* required.  The other options are.  Using the same approach for GetRolesAndPermissionsForSite, I can see that [webURL] is the only option allowed.  Since it's in brackets, I really only need to do this if I wanted to query the current site:

$().SPServices({

operation: "GetRolesAndPermissionsForSite",

completefunc: function(xData, Status) {

//do something fantastic...

//p.s. this was hand typed too and not tested...

}

});

 

Hope that clears up a few things.

Cheers,

Matt

Aug 25, 2011 at 1:12 PM

thanks again...I saw all of the information that you referenced, but didn't know how to put it together -- now I do :)

Thanks,

Todd