6

we have custom fields like e.g. Manager, Organisation, EmployeeCode. currently we are creating a custom list to add these with respective SpUser.ID, which i think is wrong.

Can any one please guide me how to add these column such that they are accessible from SPUser object ?

Many thanks in advance ...

2 Answers 2

2

Salman,

If I recall correctly, you cannot use SPUser to directly access extended properties. However, the User Information List (UIL) is just a regular list, almost like any other, so the user data of an SPUser is also exposed as a regular SPListItem object. If you add columns to the UIL you can access the extended properties through the associated SPListItem.

Here's a brief article I wrote a few years back that shows how: http://blog.furuknap.net/sharepoint-user-information-list-extensions

.b

0

Are you using SharePoint foundation or Server? Do you have the user profile service application provisioned?

When you use profiles the extra information is stored against the user profile object. You can define custom properties against the profiles and you have a profile object per user.

If on foundation or server without user profiles then all the user info is stored in a hidden user information list, theoretically you could add fields to this list and access the data although I am not sure how supported this would be.

See this blog post for more info on that list:-

http://zimmergren.net/technical/sharepoints-hidden-user-list-user-information-list

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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