Hi
I was wondering if it is possible to define a automatic state change on a workflow based on a date, that has been calculated using an object's date property.
Regards
Yaney
Option Explicit
Const INTERVAL = 6 'every 6 minutes
Dim dThisState : dThisState = PropertyValues.SearchForProperty( MFBuiltInPropertyDefStateEntered ).TypedValue.Value
Dim dDeadLineTime : dDeadLineTime = Now()
Dim tInterval, dThisStateUpdated
' Adapting the Time Zone (-3)
dThisStateUpdated = DateAdd("h",-3, dThisState)
' Calculating the interval
tInterval = DateDiff("n", dThisStateUpdated, dDeadLineTime)
If tInterval = INTERVAL Then
AllowStateTransition = true
Else
'Do nothing
End If
Option Explicit
Const INTERVAL = 6 'every 6 minutes
Dim dThisState : dThisState = PropertyValues.SearchForProperty( MFBuiltInPropertyDefStateEntered ).TypedValue.Value
Dim dDeadLineTime : dDeadLineTime = Now()
Dim tInterval, dThisStateUpdated
' Adapting the Time Zone (-3)
dThisStateUpdated = DateAdd("h",-3, dThisState)
' Calculating the interval
tInterval = DateDiff("n", dThisStateUpdated, dDeadLineTime)
If tInterval = INTERVAL Then
AllowStateTransition = true
Else
'Do nothing
End If