- Thu May 04, 2017 8:10 pm
#790645
Apologies up front - this topic was [SOLVED] in a post in the PM2 forum... viewtopic.php?t=7751
I have tried the code from the PM2 post (below) but have met with no success. I'm not really a programmer - i just feed off the scraps of other peoples' cleverness.
What I am trying to accomplish is have a user set a date (@@completionDate) at the beginning of a process and have that reflected as the Due Date for the next task. I don't want to use the Timing Controls as I want to have the process initiator set the value once and then be able to apply this to later tasks in the process.
I have set the following trigger to fire after routing:
Thanks for your patience
Greg
I have tried the code from the PM2 post (below) but have met with no success. I'm not really a programmer - i just feed off the scraps of other peoples' cleverness.
What I am trying to accomplish is have a user set a date (@@completionDate) at the beginning of a process and have that reflected as the Due Date for the next task. I don't want to use the Timing Controls as I want to have the process initiator set the value once and then be able to apply this to later tasks in the process.
I have set the following trigger to fire after routing:
Code: Select all
Has something changed in the last 5 years (?!) that would impact on this trigger running successfully? Is there anything I need to do (or NOT do) in the Task Timing Controls.$caseId = @@APPLICATION;
//lookup the user assigned to the next task in the case
$query = "SELECT MAX(DEL_INDEX) AS NEXT_INDEX FROM APP_DELEGATION WHERE APP_UID='$caseId' ";
$result = executeQuery($query);
$nextIndex = $result[1]['NEXT_INDEX'];
$duedate = date('DD-MM-YYYY', strtotime(@@completionDate) ) . ' 18:00:00';
$result = executeQuery("UPDATE app_delegation SET DEL_TASK_DUE_DATE='$duedate'
WHERE APP_UID='$caseId' AND DEL_INDEX='$nextIndex' ");
Thanks for your patience
Greg