سؤال

أريد ملء قائمة في مؤسسة SharePoint 2013 مع قائمة معلومات المستخدم.تم العثور على قائمة معلومات المستخدم في /_catalogs/users/simple.aspx (siteuserinfolist) وتحتوي على جميع إدخالات المستخدمين.

أي فكرة عن كيفية القيام بذلك؟

هل كانت مفيدة؟

المحلول

يمكنك استخدام نموذج كائن الخادم في تطبيق على أساس وحدة التحكم أو وظيفة مؤقت. احصل على جميع القيم من قائمة المستخدمين

تحقق من هذا هذا للحصول على التفاصيل.

ثم يمكنك إضافة عناصر في قائمة وجهتك باستخدام C #. يتم تقديم الرمز هنا

نصائح أخرى

The url provided is basically a oob list that contains all the user information. That means you can fetch an instance of it and perform normal list operations with it.

If using server object model, this is the code I lifted from Code Project and modified.

SPUser sUser = myweb.CurrentUser;
SPList UserList = SPContext.Current.Web.SiteUserInfoList;

SPList targetList = SPContext.Current.Web.Lists["target"];

foreach(SPListItem item in UserList.Items.GetItems()) 
{
  var newItem = targetList.Items.Add();
  newItem["UserName"] = item.Name;
  //populate column values;
  newItem.Update();
}

If you want to use different object model then there is comphrensive guide to working with list and list items using different object models : Here

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى sharepoint.stackexchange
scroll top