-
Notifications
You must be signed in to change notification settings - Fork 3
/
WorkflowDueDateTimeExceededError.xpp
39 lines (33 loc) · 1.28 KB
/
WorkflowDueDateTimeExceededError.xpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
//Author: Mafigu Huggins
//Tel: +263 782 326 160
//Email: [email protected]
//Workflow due date 0time exceeded error
static void Moeen_WorkflowDueDateTimeErrorResolution(Args _args)
{
WorkflowWorkItemTable workflowWorkItemTable;
utcDateTime dateTimeToday, setDateTime;
date dateToday, setDate;
TimeOfDay timeToday, setTime;
int i = 0;
//Change date and time as per your requirement
//DueDateTime expired before today. We will use this to filter the query below.
dateToday = str2Date("1/23/2019",213);
timeToday = str2time("12:00 am");
dateTimeToday = DateTimeUtil::newDateTime(dateToday,timeToday);
//Change date and time as per your requirement
//Set the DueDateTime to future date & time
setDate = str2Date("2/10/2019",213);
setTime = str2time("12:00 pm");
setDateTime = DateTimeUtil::newDateTime(setDate,setTime);
//Updating the expired DueDateTime and updating it to the future.
ttsBegin;
while select forUpdate WorkflowWorkItemTable
where WorkflowWorkItemTable.DueDateTime < dateTimeToday
{
workflowWorkItemTable.DueDateTime = setDateTime;
workflowWorkItemTable.update();
i++;
}
ttsCommit;
info(strFmt("%1 record(s) updated", i));
}