How to populate active directory users data in a sharepoint 2010 new list item form? -


i have custom list in sharepoint 2010 website. when adding new item list, want populate data active directory in respective fields when enter exact user id in first field. can done through sharepoint designer or through browser?

depending on user information want populate list, may find easier use sharepoint api directly , call spuser object instead.

spuser user = web.ensureuser(listitem["userfield""]); 

the ensureuser() method require give username in format: domain\user.

that being said, you'd behoove make field in question spuser field in first place. way default new item / editor makes field uses peoplepicker object bring in actual users. if need call active directory directly, can that, too, guess, since virtually in ad can exposed in sharepoint either automatically or editing user profile service application, there's not reason invoke ad directly in scenarios.


Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

CSS3 Transition to highlight new elements created in JQuery -