0

My users need a feature which will replace all instances of someone's name (assuming he/she is fired) with someone else. I use SPService's UpdateMultipleListItems action which works fine, but for people fields I apparently need to set it based on that user's ID on the website.

My users will likely complain if I tell them to enter that each time, so I was hoping there was some way for them to enter the display name so that I could query the user list and return the ID field. Or if there is a better way of setting a SharePoint user field, I am open to that as well.

2

I assume you have a customized page where these users enter the User's name and then you replace all instances of that name with a new one... To do this client side, you need to use the 'SearchPrincipals" webservice. It will return a list of possible matches based on a name/email/login name.

You might also be interested in this client side People Picker widget (full disclosure: I'm the creator/author of it), which already does this... The widget displays an autocomplete input field to the user which suggests possible user based on what they typed in... There is an API hook where you can define a callback and receive the information about the selected user. The widget uses SPServices (which sounds like you already have) and jQuery UI.

Paul.

  • I might leverage your widget at a later date, but your suggestion for SearchPrincipals was great and provided a better solution than I had planned. Thanks! – Dinerdo May 28 '14 at 4:16
  • 1
    Cool. Glad I was able to help. – Paul T. May 28 '14 at 13:25
0

You can simply use Move-SPUser Powershell command to Migrate the user..

This will update the User Information list itself..

I hope you don't want the reference to old user in User Information List.. This command is usually used when you transfer domains but it should work in your case too (within same domain)

PS: Try it in a testing environment before applying to Production..

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.