0

I need a workflow to assign a task on EndDate. Initially I just tried this with a simple Pause until date, but this cannot handle date changes (the rest of the workflow is not actioned if someone changes the date we are waiting until).

I followed this answer and ended up with this bit of workflow:

enter image description here

I can see that the end date really is being updated in my WorkFlow History, and the workflow is recognising the new date:

enter image description here

However, when the new EndDate arrives, I do not receive any emails and no tasks are assigned to me.

Why is this happening, and how can I handle a date change when pausing a workflow until some date?

2

You might try logging the output of Current Item:EndTime to the workflow history list. It may be that the comparison still holds true that Current Item:Endtime > Today and so the loop is continuing.

You could wait and see if the task gets assigned once that comparison is false and you break out of the loop. Another option would be to set a boolean variable to test against instead of the date field. Then after the pause statement you could compare the Current Item:EndTime <= Today and set the boolean variable to false which would cause you to fall out of the loop.

enter image description here

  • 1
    So after outputting Today to the history, I can see that it only ever uses the time 00:00, which is why it never works – Bassie Oct 11 '16 at 8:49
  • I'm not sure what you are doing. Are you assigning Today to a Date/Time variable and logging that variable to the history list? – MickB Oct 11 '16 at 19:04
  • I was able to resolve this with the changes in my answer – Bassie Oct 12 '16 at 8:18
1

I was able to resolve this by, making some arbitrary change to the current item at the beginning of the workflow, and then getting the modified date:

enter image description here

Then in the loop:

enter image description here

The call to Today was returning the current date, but it always had the time set to 00:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.