问题
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