我正在使用SharePoint,我試圖將服務呼叫添加到Microsoft呼叫中心應用程序模板。我可以只是一個名字下面的代碼添加一個:以編程方式將服務呼叫添加到SharePoint呼叫中心應用程序
SPSite allSites = new SPSite(siteURL);
SPWeb site = allSites.AllWebs[siteName];
SPListItemCollection requestsList = site.Lists[serviceRequests].Items;
SPListItemCollection customerList = site.Lists[customers].Items;
SPListItem item = requestsList.Add();
item["Service Request"] = "Program Test";
//item["Customer"] = "Donald Duck";
item["Customer"] = customerList[0];
item.Update();
首先,我嘗試了使用客戶名稱,沒有工作。然後我得到了客戶名單,並試圖使用客戶列表項代替,但我仍然得到同樣的錯誤:
"Invalid data has been used to update the list item. The field you are trying to update may be read only."
有沒有人有將信息從類似下面的代碼到SharePoint體驗?有沒有辦法確定哪些字段是隻讀的,如果有的話?
謝謝!
你不需要走那麼遠才能完成這項工作。將Index值設置爲Lookup字段而不是1#Value格式就足夠了。 – Kusek 2009-08-17 17:01:19
感謝您的輸入kusek – Anders 2009-08-17 17:31:46