如何通过仅更新列表项中的值(已批准、未批准)来触发 SharePoint 工作流?

发布于 2024-07-29 05:24:34 字数 188 浏览 2 评论 0原文

我是 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.

All help is appreciated!

Thanks,

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

眉目亦如画i 2024-08-05 05:24:34

您可以在 SharePoint Designer 中执行此操作。

  • 在 SharePoint Designer 中打开您的网站
  • 单击文件 新工作流程
  • 选择您的列表/库
  • 添加条件:比较列表名称字段(您可以比较您批准列中的字段中的值)

希望它有所帮助。

You can do that in SharePoint Designer.

  • Open you site in SharePoint Designer
  • Click File New WorkFlow
  • Choose your List/Library
  • Add a Condition: Compare ListName Field (you can compare values in the field in your case your approve column)

Hope it helps.

黄昏下泛黄的笔记 2024-08-05 05:24:34

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

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

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

检查两个值是否彼此不相等,以及更新后的值是否等于“approve”。 如果两者都成立,则以编程方式在列表项上启动工作流程 - 这里有一些链接可以帮助您:

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

编码愉快!

If you wish to accomplish this programmatically...

  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.

  2. 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

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

Happy coding!

焚却相思 2024-08-05 05:24:34

您可能需要两个工作流程、一个隐藏字段和一个“启动另一个工作流程活动”(可以在 CodePlex 上找到) )

工作流程 1 是一个辅助工作流程,设置为在项目更改时启动:
检查 Status 是否等于隐藏字段
如果是出口的话
如果没有,则启动工作流程 2 并将隐藏字段设置为状态工作流程 2 的当前值,

然后工作流程 2 就是真正的工作流程,当状态更改时,它将执行您想要的操作

You probably need two workflows, a hidden field and a "Start another workflow activity" (which can be found on CodePlex)

Workflow 1 is a helper workflow which is set to start when an item is changed:
It check if Status is equal to hidden field
If it is the exit
If not then start workflow 2 and set hidden field to current value of Status

Workflow 2 is then the real workflow which does what you want when Status is changed

美人骨 2024-08-05 05:24:34
  1. 首先创建一个名为“工作流程状态”的隐藏数字字段,将默认值设置为“0”

  2. 创建一个将在创建项目和修改时启动的工作流程

  3. 工作流程中的第一步是增加“工作流程状态”字段按“1”

  4. 第二步是验证该值是否为 2,这应指示第一次修改工作流.

只是为了表明状态。

工作流程状态 = 1:项目已创建
2:项目首次修改
3:项目已被第二次修改。

  1. First create a hidden numeric field called "Workflow Status" Set the default value to "0"

  2. Create a workflow that will initiate on both the creation of and item and on modify

  3. The first step in the workflow is to increase the field Workflow Status by "1"

  4. The second step is to verify is the value is 2 which should indicate the first time the workflow has been modified.

Just to indicate the status.

Workflow Status = 1: Item has been created
2: Item has been modified for the first time
3: Item has been modified a second time.

梦一生花开无言 2024-08-05 05:24:34

@Marius:工作流程的第一步应该是比较字段值并提供逻辑分支。 如果该值等于您想要的值,则运行工作流。 如果没有,请停止工作流程或执行其他操作。 如果收到的电子邮件有任何修改,那么您的流程就有问题。

Martin 的解决方案非常简单,但您还可以通过使用内容类型来扩展此解决方案,以允许执行其他操作的审批流程。

@Marius: The first step in the workflow should be to compare the field value and provide a logic branch. If the value equals what you want then run the worlflow. If not, stop the workflow or do something else. If the email is being received with any modification then you have got your flow wrong.

Martin's solution is very straightforward but you can also expand on this by using content types to allow for an approval process that performs another action.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文