Domanda

Abbiamo campi personalizzati come ad es.Gestione, organizzazione, dipendente. Attualmente stiamo creando un elenco personalizzato per aggiungerli con rispettivi spuser.ID, che penso sia sbagliato.

Qualcuno può per favore guidarmi come aggiungere questa colonna in modo che siano accessibili dall'oggetto Spuser?

Molte grazie in anticipo ...

È stato utile?

Soluzione

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

Altri suggerimenti

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

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a sharepoint.stackexchange
scroll top