- Fri Sep 02, 2016 1:13 am
#786445
hello,
i want to generate new case depending upon the given date.let me explain what i want to do.
I have dynaform where user fills the form for document compliance and select the validity date of document. in my dynaform there are six document and their validity date. I used trigger for generate a new case but i want to generate a six new case for six validity date. if two dates are same then only one case will be generated for that date. Following is my code, what should i do??
i want to generate new case depending upon the given date.let me explain what i want to do.
I have dynaform where user fills the form for document compliance and select the validity date of document. in my dynaform there are six document and their validity date. I used trigger for generate a new case but i want to generate a six new case for six validity date. if two dates are same then only one case will be generated for that date. Following is my code, what should i do??
Code: Select all
$process = @@PROCESS;
$task = '97755241357b30f9c6fe366028595037';
$case_id = @@APPLICATION;
$validityDate1 = date('Y-m-d',strtotime(@#validityDate)) . ' 18:00:00';
$validityDate2 = date('Y-m-d',strtotime(@#validityDate2)) . ' 18:00:00';
$validityDate3 = date('Y-m-d',strtotime(@#validityDate3)) . ' 18:00:00';
$validityDate4 = date('Y-m-d',strtotime(@#validityDate4)) . ' 18:00:00';
$validityDate5 = date('Y-m-d',strtotime(@#validityDate5)) . ' 18:00:00';
$validityDate6 = date('Y-m-d',strtotime(@#validityDate6)) . ' 18:00:00';
$caseUID = PMFNewCase($process, @@USER_LOGGED, $task, $case_id, $validityDate1);
//$query = "SELECT vehicle_no FROM vehicle_master WHERE vehicle_no='$vehicle_no'";
//$array_id = executeQuery($query);
//$vehicle_number = $array_id[1]["vehicle_no"];
if ($caseUID) {
executeQuery("UPDATE APPLICATION SET APP_STATUS='TO_DO' WHERE APP_UID='$caseUID'");
executeQuery("UPDATE APP_DELEGATION SET DEL_TASK_DUE_DATE='$validityDate1' WHERE APP_UID='$caseUID' AND PRO_UID='$process' AND TAS_UID='$task' ORDER BY DEL_INDEX DESC LIMIT 1");
}