[MOSS] Update lookup field value
Update Lookup Field Value Using Client Object Module
代码
using (ClientContext mySPContext = new ClientContext("http://mossdev/"))
{
Microsoft.SharePoint.Client.List oList = mySPContext.Web.Lists.GetByTitle("Items");
Microsoft.SharePoint.Client.ListItem item = oList.GetItemById(1);
item["Period"] = "1;#Q2 FY09"; //[Lookup field Id];#[Lookup field Value]
item.Update();
mySPContext.ExecuteQuery();
}
{
Microsoft.SharePoint.Client.List oList = mySPContext.Web.Lists.GetByTitle("Items");
Microsoft.SharePoint.Client.ListItem item = oList.GetItemById(1);
item["Period"] = "1;#Q2 FY09"; //[Lookup field Id];#[Lookup field Value]
item.Update();
mySPContext.ExecuteQuery();
}