不需要的工作流程电子邮件 [英] Unwanted Workflow Emails

查看:83
本文介绍了不需要的工作流程电子邮件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

美好的一天

我创建了一个列表工作流程,以便在列表项目中的特定字段发生更改时向用户发送电子邮件。这部分工作正常。

I created a list workflow to send an email to a user when a specific field in a list item has changed. This part works fine.

问题是,如果有人更改该列表项中的任何其他字段,则重复该电子邮件。

The problem is if anyone changes any other field in that list item it repeats the email.

例如:

我有一个项目状态列表,当项目阶段从"正在计划"转移到"已启动迁移"时,我想向项目分析员发送电子邮件。我在列表工作流程中使用了以下操作:

I have a project status list and I want to send an email to the Project Analyst when the stage of the project has moved from Being Scheduled to Migration Started. I used the list workflow with the action :

等待状态等同移植开始

然后通过电子邮件发送项目分析师

Then Email Project Analyst

停止工作流程

然后我必须设置工作流程设置以在项目更改时激活工作流程,此时我相信工作流程设置覆盖我创建的操作仅在状态字段已更改时发送电子邮件,而不是在该列表项中的任何
其他字段发生更改时。

I then have to set the workflow setting to activate the workflow when an item has changed, and it is at this point that I believe the workflow settings over-ride the action which I created to only email when the Status Field has changed and not when any other field in that list item has changed.

任何帮助都将不胜感激。

Any assistance would be greatly appreciated.

推荐答案

您好BAHutch。



据我所知,SharePoint Designer工作流程不允许您检查项目中的特定字段是否已更改,从而触发工作流本身:工作流将触发任何项目的字段已更改。

如果要检查特定字段的值并允许工作流程启动或不启动,则必须编写自定义协议de实现

SPItemEventReceiver.ItemUpdated
方法:
SPItemEventProperties
此方法的参数包含有关列表项事件的信息,包括  AfterProperties

BeforeProperties
属性,它们分别获得一个属性的哈希表,该表包含对应于SPItem对象中的字段的字符串/值对在事件发生之前;这些属性将允许您
在值已更改的项目中找到确切的字段,因此您可以选择是否触发工作流程。



再见
Hi BAHutch.

As far as I know, a SharePoint Designer workflow does not allow you to check whether a specific field in an item has changed thus firing the workflow itself: the workflow will fire whatever item's field has changed.
If you want to check for a specific field's value and allow the workflow to start or not, you have to write custom code to implement the SPItemEventReceiver.ItemUpdated method: the SPItemEventProperties parameter for this method contains information about list items events, including the AfterProperties and BeforeProperties properties, which respectively get a hash table of properties consisting of string/value pairs that correspond to fields in the SPItem object after and before the event occurred; those properties will allow you to find the exact field in the item whose value has changed, so you will be able to choose whether to fire the workflow or not.

Bye.


这篇关于不需要的工作流程电子邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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