开发者

unable to update listitem external data column sharepoint 2010

I try update Extenal data column but it doesn't work, new value is not stored. (new value is visible on details form but not on list, rehreshing external data type does not return related external column values)

using (SPSite oSiteCollection = new SPSite("开发者_高级运维site.com"))
{
    using (SPWeb oWebsite = oSiteCollection.OpenWeb("site.com"))
    {
        using (SPWeb oWebsiteRoot = oSiteCollection.RootWeb)
        {
            SPList docLib = oWebsiteRoot.Lists["list name"];

            SPListItemCollection items = docLib.Items;
            foreach (SPListItem item in items)
            {
                //item["n"] is external column data field 

                item["n"] = item["notice"].ToString();
                item.UpdateOverwriteVersion();
            }
        }
    }
}


Check using item.Update() insted of item.UpdateOverwriteVersion()


This has to do with the field type and is quite complicated to get right.
There is a free external data field migration/copy tool here: http://rrfreeman.blogspot.com/2013/06/bcs-bdc-external-data-lookup-field.html

I included source code and links to relevant articles.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜