Questions and discussion about using ProcessMaker: user interface, running cases & functionality
#827749
My process has 3 tasks, Task2 DynaForm has a dropdown in a grid, and its options are from an array variable, which is set in a trigger using sql to select from a PM Table. In Task3, I copy the grid with dropdown from Task2, however, the value dispalyed of the two dropdowns in the grid are not what I set in Task2. In debug mode, the value of the dropdowns are the same with Task2.

Thank you.
My PM version is 3.4.7 community.

The trigger to select options from a PM Table.
Code: Select all
@%app_no = (int)@@APP_NUMBER;
$a = @%app_no;
$sql = "SELECT F_TITLE FROM PMT_TITLE WHERE F_APP_NUMBER = '$a'";
$ta = executeQuery($sql);
$out =array();
@@title_array = array();
for ($i = 1; $i <= count($ta); $i++) {
	$out[1] = $ta[$i]['F_TITLE'];
	@@title_array[$i] = $out;
}
The tigger to set the array variable.
Code: Select all
$t = '';
if (!empty(@=gridVar001)) {
	foreach (@=gridVar001 as $g){
   		$t  = $g['title_id_label'];
		@%app_no = (int)@@APP_NUMBER;
		$a = @%app_no;
		$insert = "INSERT INTO PMT_TITLE (ID, F_TITLE, F_APP_NUMBER) VALUES (NULL,'$t', '$a')";
		executeQuery($insert);
	}
}
Attachments
火狐截图_2020-03-19T01-47-00.182Z.png
火狐截图_2020-03-19T01-47-00.182Z.png (10.12 KiB) Viewed 5030 times
火狐截图_2020-03-19T01-26-24.231Z.png
火狐截图_2020-03-19T01-26-24.231Z.png (8.36 KiB) Viewed 5030 times
火狐截图_2020-03-19T01-25-42.989Z.png
火狐截图_2020-03-19T01-25-42.989Z.png (4.17 KiB) Viewed 5030 times
#827805
In ProcessMaker, grid starting from 1.
To copy grid 1 to grid 2, you can try:
Code: Select all
//clear value grid2
@=grid2 = [];
$grid2Index = 1;
//copy grid 1 to grid 2
foreach (@=grid1 as $key => $value) {
	@=grid2[$grid2Index] = ["grid_drop" => $value];
	$grid2Index++;
}

Hello. For rental housing, there are software solu[…]

Experience heightened pleasure with Cenforce 100 M[…]

Get an instant solution to move emails to MBOX for[…]

Most Demanding OST to PST Converter

The most demanding OST to PST Converter is TrijaT[…]