views:

850

answers:

1

I am trying to update a field of type spFieldUserValue, you know a, PeoplePicker.

The relevant code is

batchElement.InnerXml = "<Method ID='1' Cmd='Update'>" +
    "<Field Name='ID'>1</Field>" +
    "<Field Name='APersonField'>32;#This is pretty much ignored</Field>" +
    "<Field Name='Title'>Wow edited!</Field></Method>";
result = listService.UpdateListItems(strListID, batchElement);

As my code succesfully updates the APersonField with whomever is No.32 for that website (for clarification, they are not named "This is pretty much ignored", which seems to be ignored.

Anyhow, how would I, given an account name of the format [domain][user] find the relevant Number for thier lookup id in the security of the site using only the web services?

+2  A: 

I believe that the number is the User's ID within the site. This can be determined using the Users and Groups web service by calling UserGroup.GetUserInfo (see this MSDN page for details)

Yuliy