开发者

Howto I get the user domain\username and Display name From SharePoint People Picker InternalId?

I have been trying to user sharepoint designer to retrieve the user's full name and even the domain\username from the people pucker field but the problem 开发者_如何学运维is I tend to get numbers. It looks like the intetrnal Id. In my case I am getting 14 instead of domain\username from the list form's field.

Any idea on where I can get the dmain\username or even better the full name?

Thanks !!

I am using SharePoint Designer and Windows Sharepoint Services 3/SharePoint 2007.

Update :

I have managed to get the domain\username now. I just had to change the people picker's show field to ID. However now I am getting a weird prefix on my domain\username. I am getting this -1;#domain\username instead of just domain\username. Anybody know how I can overcome this?

Thanks !!


I don't know how to avoid getting the information in that format, but I know how to get rid of the "1;#" part.

Assuming the variable "theName" contains "1;#domain\username", then you can do:

Dim poundSignIndex As Integer = theName.IndexOf("#") + 1
theName = theName.Substring(poundSignIndex)

That will remove everything before the "domain\username" part of the string.

Leon.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜