0

I'm specifying a timeout in a workflow within CRM against a particular contact attribute (Next Time To Run):

Timeout until "Contact:Next Time To Run"

This works great, until someone updates the "Next Time To Run" attribute. When this happens, CRM re-evaluates the timeout and adjusts it to the new "Next Time To Run" value. This is what I don't want. I want the timeout to use the value of the "Next Time To Run" when the workflow was originally triggered (static). I don't want the timeout to dynamically update based on the attribute changing.

How do I do this?

Daryl
  • 18,592
  • 9
  • 78
  • 145

2 Answers2

1

I just tried this solution and I believe it solves your problem:

I added an extra field ("Hidden Time To Run") to the entity, a date field that doesn't appear on the form.

Workflow steps:

  1. When the workflow is triggered, copy the date from "Next Time To Run" to "Hidden Time To Run".
  2. Timeout until "Contact: Hidden Time To Run"

Thus, changing the "Next Time To Run" attribute won't have an effect on when the workflow is expected to run.

HenricF
  • 218
  • 3
  • 19
1

I have a Custom Workflow Activity that adds a configurable amount of time to a date. I just called the Activity and didn't actually increment it. It returned a value that was static, and resulted in the timeout being unchanged if the attribute it was based on changed.

Daryl
  • 18,592
  • 9
  • 78
  • 145
  • When the workflow triggers and can you post you Custom Workflow Activity logic? – Sxntk Apr 15 '15 at 20:21
  • @Sxntk Do you want the logic because you want to be able to increment a date, or do you want to be able to perform a static value evaluation? – Daryl Apr 16 '15 at 18:06
  • I want to see what you are doing – Sxntk Apr 16 '15 at 19:47
  • @Sxntk I want to be as clear that I understand what you're asking for. Do you want to see the workflow activity that will add Months/Days/Hours/Minutes/Seconds to a Date? Or do you want to see a Code Activity that will return a static DateTime to be used in a workflow? – Daryl Apr 17 '15 at 00:22
  • I want to see the code activity, what are you passing to the custom and how you are incrementing the date. If it is possible the workflow but I think we can do something with the custom. – Sxntk Apr 17 '15 at 13:51