Share ideas, ask questions, and get feedback about developing for ProcessMaker

Moderator: amosbatto

Forum rules: Please post new questions under "Developing processes & programming" for ProcessMaker 2 or 3.
User avatar
By amosbatto
#813193
The problem is your "Get initial information" trigger.
I changed this line:
Code: Select all
if($employeeInfo['departmentname'] != ""){ 
To:
Code: Select all
if(isset($employeeInfo['departmentname']) and $employeeInfo['departmentname'] != ""){ 
The problem is that the ['departmentname'] element is only created if the user is a member of a department, so you have to first check that it exists with isset() before trying to access it.
By hildaz2010
#813208
I SOLVE MY question
but now I find know question
why i didn't get documents

this my javascript
Code: Select all
//Get the links for the documents
var totalRows = $("#gridAttach").getNumberRows();
for(i=1; i<=totalRows; i++){
	
	var docUid = document.getElementById("form[gridAttach]["+i+"][docUid]").value;
	var docName = document.getElementById("form[gridAttach]["+i+"][docName]").value;
	document.getElementById("form[gridAttach]["+i+"][linkAttach]").href = "../cases/cases_ShowDocument?a="+docUid;
	document.getElementById("form[gridAttach]["+i+"][linkAttach]").innerHTML = "<center>"+docName+"</center>";
}
and this my trigger
Code: Select all
//Count the attach on the grid
$cntGridAttach = 0;
foreach(@@gridAttach as $row){
	
	@@cntGridAttach++;
}
$sqlSdoc = "SELECT *
FROM CONTENT C, (SELECT *
FROM APP_DOCUMENT D
WHERE D.APP_UID = '"[email protected]@APPLICATION."'
AND D.APP_DOC_FIELDNAME LIKE '%gridAttach%'
ORDER BY D.APP_DOC_INDEX DESC 
LIMIT "[email protected]@cntGridAttach.") X
WHERE C.CON_ID = X.APP_DOC_UID
AND C.CON_CATEGORY = 'APP_DOC_FILENAME'
ORDER BY X.APP_DOC_INDEX ASC";
$resSdoc = executeQuery($sqlSdoc);

foreach($resSdoc as $key => $row){
	
	@@gridAttach[$key]['docUid'] = $row['CON_ID'];	
	@@gridAttach[$key]['docName'] = $row['CON_VALUE'];	
}
User avatar
By amosbatto
#813230
Change:
Code: Select all
$cntGridAttach = 0;
foreach(@@gridAttach as $row){
   
   @@cntGridAttach++;
}
To:
Code: Select all
@%cntGridAttach = 0;
foreach(@@gridAttach as $row){
   
   @%cntGridAttach++;
}
Have you tested your SQL query to verify that it is correct? I find that AppDocument::Load() is much easier to use than complicated database queries.
By hildaz2010
#813236
I think my trigger has got documents
but my arrove form can't get right information of documents
from javascrip result that my arrove form not show the documents name and link to download
homecut 004.jpg
homecut 004.jpg (15.29 KiB) Viewed 838 times
the correct results like be this one
homecut 043.jpg
homecut 043.jpg (8.56 KiB) Viewed 838 times
my code is same as trial
Code: Select all
//Get the links for the documents
var totalRows = $("#gridAttach").getNumberRows();
for(i=1; i<=totalRows; i++){
	var docUid = document.getElementById("form[gridAttach]["+i+"][docUid]").value;
	var docName = document.getElementById("form[gridAttach]["+i+"][docName]").value;
	document.getElementById("form[gridAttach]["+i+"][linkAttach]").href = "../cases/cases_ShowDocument?a="+docUid;
	document.getElementById("form[gridAttach]["+i+"][linkAttach]").innerHTML = "<center>"+docName+"</center>";
}
Code: Select all
//Get the link for the case tracker
$httpServer = (isset($_SERVER['HTTPS'])) ? 'https://' : 'http://';
$caseTrackerPath = $httpServer.$_SERVER['HTTP_HOST']."/sys"[email protected]@SYS_SYS."/"[email protected]@SYS_LANG."/neoclassic/tracker/login";
$caseTrackerLink = '<a href="'.$caseTrackerPath.'">'.$caseTrackerPath.'</a>';
I think I can't understand these two parts
can u teach me
User avatar
By amosbatto
#813250
hildaz2010 wrote:
Code: Select all
//Get the link for the case tracker
$httpServer = (isset($_SERVER['HTTPS'])) ? 'https://' : 'http://';
$caseTrackerPath = $httpServer.$_SERVER['HTTP_HOST']."/sys"[email protected]@SYS_SYS."/"[email protected]@SYS_LANG."/neoclassic/tracker/login";
$caseTrackerLink = '<a href="'.$caseTrackerPath.'">'.$caseTrackerPath.'</a>'; 
I think I can't understand these two parts
can u teach me
This is a trigger that creates a link to login to the Case Tracker.
If you have this trigger:
Code: Select all
//Get the link for the case tracker
$httpServer = (isset($_SERVER['HTTPS'])) ? 'https://' : 'http://';
$caseTrackerPath = $httpServer.$_SERVER['HTTP_HOST']."/sys"[email protected]@SYS_SYS."/"[email protected]@SYS_LANG."/neoclassic/tracker/login";
@@caseTrackerLink = '<a href="'.$caseTrackerPath.'">'.$caseTrackerPath.'</a>'; 
And you have a email or Output Document template with this content:
Code: Select all
To see your case, go to:
@#caseTrackerLink
Enter the following Case Number and PIN to see details about your case:
Case No: @#APP_NUMBER
PIN: @#PIN
Set the above trigger to execute before the Output Document or email in your process.
User avatar
By amosbatto
#813251
my code is same as trial
Code: Select all
//Get the links for the documents
var totalRows = $("#gridAttach").getNumberRows();
for(i=1; i<=totalRows; i++){
   var docUid = document.getElementById("form[gridAttach]["+i+"][docUid]").value;
   var docName = document.getElementById("form[gridAttach]["+i+"][docName]").value;
   document.getElementById("form[gridAttach]["+i+"][linkAttach]").href = "../cases/cases_ShowDocument?a="+docUid;
   document.getElementById("form[gridAttach]["+i+"][linkAttach]").innerHTML = "<center>"+docName+"</center>";
} 
This is JavaScript code added to a Dynaform to set the links inside a grid to view or download the files in a case. These files were previously uploaded to an Input Document step or File control in a Dynaform.

I logged into your account and fixed your process. The problem was that you changed the variable for the grid in the "application" form from "gridAttach" to "gridvar001". When I changed the variable back to "gridAttach", and made the code change I explained in the previous post, then it worked.

However, I don't understand why you are using Grids to upload files. It is much easier to use a FileUpload control in place of a grid with a File control inside it. The FileUpload control doesn't require any custom code to redisplay files.
By hildaz2010
#813258
Thanks for your help
can i ask another question~
my first task can let user to choose who has sign it
but when second task reject return first task not back to "original"
is back to choose "who has sign it":?
User avatar
By amosbatto
#813276
To route the case back to the first task, you need create a group of users who can be assigned to the first task. Let's call the group "Approvers".

Then, set your first task to use "Value Based Assignment" and set its variable:
@@signOffUser

Then add a dropdown box to a Dynaform associated with the variable "signOffUser". Add the following "sql" to the dropdown:
Code: Select all
SELECT U.USR_UID, CONCAT(U.USR_FIRSTNAME, ' ', U.USR_LASTNAME) 
FROM (USERS U LEFT JOIN GROUP_USER GU ON U.USR_UID=GU.USR_UID) 
LEFT JOIN CONTENT C ON GU.GRP_UID=C.CON_ID 
WHERE C.CON_VALUE='Approvers'
Then, when the case is routed back to the first task after the gateway, then it will be routed to the user selected in the "signOffUser" dropdown box.
Calculate hours of day/week

Thank you Amos, The four other variables are for[…]

timing control

I suggest that you file a bug report about it at[…]

Hello Amos, Would this solution work also for PM […]

Hi amosbatto! When I send a request from ajax to[…]