1
我有一個員工列表,其中有2列(部門和經理),這是查找列。當新用戶註冊時,我需要代碼來更新這些查找列。 (雖然其它列被在列表更新)如何使用網格更新Sharepoint查找列?
以下是代碼:
using (ClientContext clientContext = new ClientContext("https://sp13appstoredev.xyz.com/sites/DevApps/TrainingSite/"))
{
clientContext.Load(clientContext.Web, web => web.Title);
List oList = clientContext.Web.Lists.GetByTitle("Employees");
clientContext.Load(oList);
ListItemCreationInformation itemInfo = new ListItemCreationInformation();
Microsoft.SharePoint.Client.ListItem myItem = oList.AddItem(itemInfo);
myItem["Title"] = txtFirstName.Text;
myItem["Last_x0020_Name"] = txtLastName.Text;
myItem["u5ib"] = txtAge.Text;
myItem["Address"] = txtAddress.Text;
//FieldLookupValue lookUpDepartment = new FieldLookupValue();
//myItem["Department"] = lookUpDepartment as FieldLookupValue;
//FieldLookupValue lookUpManager = new FieldLookupValue();
//myItem["Manager"] = lookUpManager as FieldLookupValue;
myItem["Gender"] = radioBtnGender.Text;
myItem["Salary"] = txtSalary.Text;
myItem.Update();
clientContext.ExecuteQuery();
}
我評論查找列線,以檢查是否在列表中被更新的另一列。
請幫忙。謝謝:)