SharePoint 'my membership' webpart counters in community site

安稳与你 提交于 2020-01-06 07:24:07

问题


in a SharePoint 2013 community site, there are a bunch of counters under the members list. Unfortunately these fields are readonly.

When we programmatically import discussions (via managed API CSOM), the counters are updated. Before importing, we clear the list of discussions and then the counters for each member are not reduced. When manually deleting items, they are reduced :(

Can anyone point out how to be able to update the membership webpart statistics via CSOM (or SSOM if needed).

Thanks in advance!


回答1:


using SSOM:

        _web.Properties["Community_TopicsCount"] = 100;
        _web.AllProperties["Community_TopicsCount"] = 100;

        _web.Properties["Community_RepliesCount"] = 100;
        _web.AllProperties["Community_RepliesCount"] = 100;

        _web.Properties["Community_MembersCount"] = _web.SiteUsers.Count.ToString();
        _web.AllProperties["Community_MembersCount"] = _web.SiteUsers.Count.ToString();

        _web.Properties.Update();
        _web.Update();


来源:https://stackoverflow.com/questions/33497209/sharepoint-my-membership-webpart-counters-in-community-site

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!