社区网站中的 SharePoint“我的会员"网页部件计数器 [英] SharePoint 'my membership' webpart counters in community site

查看:35
本文介绍了社区网站中的 SharePoint“我的会员"网页部件计数器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 SharePoint 2013 社区网站中,成员列表下有一堆计数器.不幸的是,这些字段是只读的.

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

当我们以编程方式导入讨论(通过托管 API CSOM)时,计数器会更新.在导入之前,我们清除讨论列表,然后每个成员的计数器都不会减少.手动删除项目时,它们会减少:(

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 :(

谁能指出如何通过 CSOM(或 SSOM,如果需要)更新成员资格 Webpart 统计信息.

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

提前致谢!

推荐答案

使用 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();

这篇关于社区网站中的 SharePoint“我的会员"网页部件计数器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆