Questions and discussion about developing processes and programming in PHP, JavaScript, web services & REST API.

Moderator: amosbatto

Forum rules: Please search to see if a question has already asked before creating a new topic. Please don't post the same question in multiple forums.
#824906
Hi,
There were some strange issues happening with duplicate cases created (PMFCreateNewCase()) by a trigger fired on "before routing" and I'm assuming this could be due to the use of Edge (or other) browser different from Firefox! Do you have any tip?
Now, I need to pause (i wanted to cancel or delete if possible?) these cases and the system is poping up the error message: "The case has not stopped due to its trigger".
What it's happening here?
Thank you very much.
#824909
Thanks Amos.
See the code below:
Code: Select all
//TRIGGER
$taskId    = '1986389165ba25200c004b7024400992';  //set to starting task's unique ID
$processId = PMFGetProcessUidByName("განყოფილების მომსახურება");  //set to the process' unique ID
//$processId = PMFGetProcessUidByName("Service at Division");  //set to the process' unique ID
$userLogged = @@USER_LOGGED;
//Only the rows not marked as Refused will generate services. They were removed before
for ($j = 1; $j <= count(@=gridDivision); $j++) {
	$aData = array(     
		'OrderID'    				=> @%OrderID,
		'OrderNumber'    			=> @@OrderNumber,
		'OrderCustomerNumber' 		=> @@OrderCustomerNumber,
		'ContractID'    			=> @%ContractID,
		'ContractNumber'    		=> @@ContractNumber,
		'ContractCustomerNumber'   	=> @@ContractCustomerNumber,
		'ContractDate'			   	=> @@ContractDate,
		'TypeOfService'    			=> @=gridDivision[$j]['TypeOfService'],
		'TypeOfServiceName'    		=> @=gridDivision[$j]['TypeOfServiceName'],
		'MiName'    				=> @=gridDivision[$j]['Title'],
		'MiServiceLocal'    		=> @=gridDivision[$j]['ServiceLocal'],
		'MiSerialNumber'    		=> @=gridDivision[$j]['SerialNumber'],
		'Division'    				=> @=gridDivision[$j]['DivisionID'],
		'ServicePlanNote' 			=> @=gridDivision[$j]['Note'],
		'DivisionName'				=> @@DivisionUser,
		'CustomerID'				=> @%CustomerID,
		'CustomerName'				=> @@CustomerName,
		'ContactName'				=> @@ContactName,
		'ContactMobile'				=> @@ContactMobile,
		'ContactEmail'				=> @@ContactEmail,
		'CustomerAddress'			=> @@InvoicingAddress
	);
	
	$newCaseId = PMFNewCase($processId, $userLogged, $taskId, $aData, "TO_DO");
	//This code it is needed to put the case in bold at Inbox
	$user_loged = @@USER_LOGGED;
	$user = @@USER_LOGGED;
	$userInfo = userInfo($user_loged);
	$query = "
		UPDATE `APP_CACHE_VIEW`
		 SET `USR_UID` = '".$user."', `DEL_INIT_DATE` = NULL, `APP_STATUS` = 'TO_DO',
			`PREVIOUS_USR_UID` = '".$user_loged."',
			`APP_DEL_PREVIOUS_USER` = '".$userInfo['lastname'].' '.$userInfo['firstname']."'
		WHERE `APP_UID` = '".$newCaseId."';
	";
	executeQuery($query);
	//}
}
#824938
Hi Amos,
Thanks again.
The next task is a "Value based assignment" and it is working fine for other users, but for this (it happen also with another) there are duplicated cases (it seems the trigger is executed more than once!). I suspected that it might be the Browser and I suggested to use Firefox (the one I use and never happen this in my tests) instead of Chrome. I also found out some issues with Edge (losing data on the swimlanes: disapearing tasks, assignment rules, flows).
For now, I just wanted to fix these Cases; removing them from inbox. Either by cancelling or pausing. The error appears when I tried to Pause. How can I do that?
Thanks.
#824950
You can manually create a record for the case in the APP_THREAD table, so that the case can be canceled or paused.

If you can't figure out what values to put in the APP_THREAD table, then I recommend that you simply delete the records for this case in the APP_DELEGATION, APP_CACHE_VIEW and APPLICATION tables to make the case disappear.

Yeah That will be very helpful :) Thank you

variable in external libs

Ohhh I tried this thing before but didn't work tha[…]

Limit List box

Hello Amos, The following solution is working. $[…]

It looks like jquery.masknumber.js has problems in[…]