I need to maintain the dates of Task records: The end of one needs to be the start of the next:
So I created an automation process that is fired when [Start] or [End] changes, so I loop all Task records to review the [Start] and [End] of all and make the necessary changes.
This is done with an automation step set as “Run a data action” → “Run action on rows”. The query is:
ORDERBY( FILTER(tasks, TRUE, [Order])
And call the action to update the [Start] and [End] fields:
[Start] =
IF( [_THISROW].[Order] <> 1,
ANY(SELECT(tasks[End], [Order] = [_THISROW].[Order]-1 )),
[_THISROW].[Start]
)
[End] =
IF( [_THISROW].[Order] <> 1,
ANY(SELECT(tasks[End], [Order] = [_THISROW].[Order]-1 )),
[_THISROW].[Start]
) + [_THISROW].[Duration]
THE PROBLEM
For some reason, only the first Task record updates correctly; the next ignores the previous updated [End] field, keeping the old End value.
For example, consider the row with [Order] = 1. If I change the [End] to 19/05/2023 19:40:00,
the next row with [Oder] = 2 will have [Start] = 19/05/2023 19:40:00 and [End] = 19/05/2023 21:40:00
But the next Task with [Order] = 3, keeps the same value, ignoring the update made in the [Order] = 2.
Is this a bug? A transaction issue?
