SharePoint警报无法正常工作

编程入门 行业动态 更新时间:2024-10-26 17:29:34
本文介绍了SharePoint警报无法正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我在SharePoint 2013基础上进行开发.对于某些SharePoint列表,将立即为特殊用户创建警报.以编程方式创建警报. 用户注意到列表项字段通过电子邮件发生了变化.因此可能会问,当列表字段更改的时间不同时,用户仅收到一封更改的电子邮件,为什么?有关更多信息,该字段更改后立即运行警报计时器作业.如何配置 以编程方式(C#)发出警报,以便发出警报以应对两个更改或存在另一种方法?

I develop on SharePoint 2013 foundation. For some SharePoint list there is immediately created alert for special user. Alert created programmatically. User noticed about list items fields changing through email. So may question when list fields changed different times user receive email only for one change, why? For more information Immediately Alert timer job run after that fields changing. How to configure alert programmatically (C#) in order alert to work for two changes or there is another way?

推荐答案

古尔根,

请在下面创建类似代码段的警报:

Please create the alert like code snippet below:

static void Main(string[] args) { using (SPSite site = new SPSite("sp/sites/dev")) { using (SPWeb objWeb = site.OpenWeb()) { objWeb.AllowUnsafeUpdates = true; SPList list = objWeb.Lists["RestDate"]; SPUser currentuser = objWeb.CurrentUser; SPAlert newAlert = currentuser.Alerts.Add(); newAlert.Title = list.Title; newAlert.AlertType = SPAlertType.List; newAlert.List = list; newAlert.DeliveryChannels = SPAlertDeliveryChannels.Email; newAlert.EventType = SPEventType.Modify; newAlert.AlertFrequency = SPAlertFrequency.Immediate; newAlert.Update(); objWeb.Update(); } } }

它将发送多个更改的警报,如下所示:电子邮件警报:

And it will send alert for multiple changes, see the email alert like below:

已更改标题警报:

更改了日期字段警报:

谢谢

最好的问候

更多推荐

SharePoint警报无法正常工作

本文发布于:2023-11-27 05:28:17,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1636786.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:警报   无法正常   工作   SharePoint

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!