我将初始化共享点列表的项目。其中一个字段是查找字段,但是当我要初始化它时,没有为其设置任何值。
这是我的代码:
var clientContext =
new ClientContext(aURL)
{
Credentials = new System.Net.NetworkCredential(somestring)
};
Web oWebsite = clientContext.Web;
List teachersList = oWebsite.Lists.GetByTitle("Teachers");
FieldLookupValue lookupField = new FieldLookupValue();
lookupField.LookupId = anInteger;
teacherInfoListItem["ProfessorID"] = lookupField;
teacherInfoListItem["Title"] = value;
teacherInfoListItem["LastName"] = value;
teacherInfoListItem.Update();
clientContext.ExecuteQuery();
www说
相关分类