简体   繁体   English

CRM 2011:如何在更改时停止工作流

[英]CRM 2011: How to stop a workflow on change

I have a process which fires on the change of custom_status (Status set to 'Awaiting Response'). 我有一个在custom_status更改(状态设置为“等待响应”)时触发的过程。 Process sends two emails after 4 days and 7 days the change was made. 进行更改的4天和7天后,流程会发送两封电子邮件。 Email dates are extracted from custom fields set by a plugin which triggers on custom_status change. 电子邮件日期是从由插件设置的自定义字段中提取的,该插件会在custom_status更改时触发。 So there is a timeout condition which wait for 4 days and them 3 days after that. 因此,有一个超时条件,需要等待4天,然后等待3天。

Now I have a change request to stop the process if custom_status is changed again (Set to anything other than 'Awaiting Response') with in the waiting period. 现在,我有一个更改请求,如果在等待期间内再次更改了custom_status(设置为“ Awaiting Response”以外的任何内容),则停止该过程。

Basic idea behind it is if with in last 3 days of waiting custom_status is changed to 'In Process' and changed back to 'Awaiting Response'. 其背后的基本思想是,在过去3天的等待中,custom_status更改为“处理中”,然后又更改为“等待响应”。 A new instance of workflow will kick in and existing process should not be completed. 一个新的工作流实例将启动,并且现有过程不应完成。 As emails are sent on that date set on change. 由于电子邮件是在该日期设置的,因此必须进行更改。 Both (New & Old) workflow will send the 2nd email. (新旧)工作流程都将发送第二封电子邮件。 user will recieve 2 emails. 用户将收到2封电子邮件。

Can anyone suggest me how to achieve this. 谁能建议我如何实现这一目标。

Many Thanks 非常感谢

You don't need code to achieve this, native workflow is just fine. 您不需要代码即可实现此目的,本机工作流程就可以了。

In your wait condition, add a parallel wait until the custom_status field is not equal to Awaiting Response. 在您的等待条件中,添加一个并行等待,直到custom_status字段不等于等待响应。 Adding a parallel wait is similar to adding an "otherwise" to an IF. 添加并行等待类似于向IF添加“否则”。

A parallel wait will stop waiting when one or the other condition is met. 当满足一个或另一个条件时,并行等待将停止等待。 So this will wait for 3 days or until the status is changed to something other than Awaiting Response, whichever comes sooner. 因此,它将等待3天,或者直到状态更改为“等待响应”以外的其他值,以较早者为准。 Once the wait is over, then use an IF condition to check the current value of custom_status, and only if it is still Awaiting Response do you send the email (because this tells you it must have stopped waiting due to 3 days expiring, rather than status change. 等待结束后,请使用IF条件检查custom_status的当前值,并且只有在它仍在等待响应时,您才发送电子邮件(因为这表明您必须由于3天过期而停止了等待,而不是状态改变。

How about a parallel wait condition? 并行等待条件如何? Your main wait condition should wait on those two date fields; 您的主要等待条件应该在这两个日期字段上等待; your parallel wait condition would wait for custom_status to change. 您的并行等待条件将等待custom_status更改。 If it does, stop the workflow. 如果是这样,请停止工作流程。

Here's a link to a blog that describes using parallel waits to solve a requirement very similar to yours: 这是博客的链接,描述了使用并行等待来解决与您的需求非常相似的需求:

http://ashwaniashwin.wordpress.com/tag/microsoft-dynamics-crm-2011-workflow-parallel-wait-branch-conditions/ http://ashwaniashwin.wordpress.com/tag/microsoft-dynamics-crm-2011-workflow-parallel-wait-branch-conditions/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM