I have a very odd problem, one that's been baffling me for over a week now. I have a workflow designed to create a new task a set period of time in the future once a current task expires. These tasks have a reminder date and a due date, a certain number of days apart.
Now, the workflow works by calculating the number of days between the due date and reminder date (which returns a negative number) and storing it in a variable (x), adding the fixed amount of time to the due date, and then adding the variable x to the new due date to get the new reminder date.
The problem in this workflow lies in how we're using it. When we run the workflow manually, the new task is generated properly and all dates match up. However, we want to run it on all items of a list, so we set the workflow to run daily using Harepoint Workflow Scheduler. When we run it using Harepoint though, strange things happen. The new due date is calculated properly, however the new reminder date has been severely miscalculated.
For example, an item with due date 8/11/2014 and reminder date 8/4/2014 (a bi-monthly task) generates a new item with due date 8/26/2014 and reminder date 9/25/2012 when run with Harepoint.
Note: I've tried a Powershell script to run the workflow on all list items to the same result. No luck.
After a bit of examination in the workflow itself, I discovered that something strange is happening when I use the "Find Interval Between Dates" workflow action to find the number of days between the due date and reminder date.
When run manually, the variable x (which holds the number of days outputted by the action) is -7 (correct). However, when run with Harepoint, the variable x is -700.
Is there some reason that running this workflow on all list items is messing with that calculation? Why is that happening? And is there anything I can do to fix this?
Any help would be appreciated. Thank you for your time.
Note: I've narrowed the problem down to that one line, which finds the number of days between due date and reminder date. When that action is executed by Harepoint or Powershell, unexpected values occur.
Note: The Powershell script produces the same problem as Harepoint, so that's not the problem.