Hello everyone,
I am new to K2 and trying to implement a workflow... more specifically an escalation.
I am trying to get an escalation to fire 2 days before some due date. This due date is entered into a form using a calendar. I am trying the following, but it seems that my IF statement never equals true... can someone provide some insight at to what i am doing wrong?
Thanks in advance!
Sub Main(Byval K2 as EscalationRuleContext)
Dim shipDate As Date
Dim strDateTime As String
strDateTime = SourceCode.K2Utilities.XMLFieldMod.GetXMLValue(K2.ProcessInstance.XmlFields("K2InfoPathSchema").Value,"my:myFields/my:Order_Tab/my:Order_Latest_Ship_Date")
shipDate = Date.Parse(strDateTime)
shipDate.AddDays(-1)
If ( shipDate.CompareTo(System.DateTime.Today()) <= 1 )
K2.SetEscalationRule( shipDate, 0, 0, 0, 0, 0 )
Else
K2.SetEscalationRule( system.DateTime.Now() )
End If
End Sub