如何通过仅更新列表项中的值(已批准、未批准)来触发 SharePoint 工作流? [英] How to trigger a SharePoint workflow by updating ONLY a value in a list item (approved, not approved)?

查看:54
本文介绍了如何通过仅更新列表项中的值(已批准、未批准)来触发 SharePoint 工作流?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是 SharePoint 的新手,但我学得很快.

I am new to SharePoint but I learn quick.

我只想在列表项中的值更新时触发工作流,而不是在每次更改项时触发.例如,我有一列批准/不批准,我希望它成为触发器而不是项目中的其他值.因此,如果其他任何内容发生更改,除非批准"值是,否则工作流程将不会启动.

I want to trigger a workflow only when a value is updated in a list item, but not everytime the item is changed. For example I have a column for approve/not approve and I want that to be the trigger not the other values in the item. So if anything else is changed the workflow will not start unless the 'approval' value is.

感谢所有帮助!

谢谢,

推荐答案

如果您希望以编程方式完成此...

If you wish to accomplish this programmatically...

  1. 创建一个 ItemUpdating 事件处理程序并将其附加到您的目标列表.我会创建一个功能和功能接收器来进行附加.

  1. Create a ItemUpdating event handler and attach it to your target list. I would create a feature and feature receiver to do the attaching.

在 ItemUpdating 事件处理程序中,您需要查看两个值:properties.ListItem["Approval"] 这会给你原始值properties.AfterProperties["Approval"] 这是更新后的值

In the ItemUpdating event handler, there are two values you want to look at: properties.ListItem["Approval"] this will give you the original value properties.AfterProperties["Approval"] this is the updated value

检查两个值是否不相等,更新后的值是否等于approve".如果两者都为真,请以编程方式在列表项上启动工作流 - 这里有一些链接可以帮助您:

Check if the two values are not equal to each other, and if the updated value is equal to "approve". If both are true, start a workflow on the list item programmatically- here are some links to help you with that:

http://www.tonytestasworld.com/post/Howto-Start-a-Sharepoint-Workflow-Programmatically.aspx

快乐编码!

这篇关于如何通过仅更新列表项中的值(已批准、未批准)来触发 SharePoint 工作流?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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