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.
#827042
https://wiki.processmaker.com/3.0/Repor ... port_Table

Has anybody tried using this code? I tried using it, but it only seems to copy the first record and ignore the rest. I tried manipulating it by changing the initial index to 2, to see if it would get the 2nd record incase there was an error in the 2nd record, however it works. I thought maybe the grid count wasn't get the number correctly, so I change that to a static number of the rows I knew to be there, but that still only grabbed the first record. It's as if the first time it loops is all it can do.
Last edited by richvle on Mon Dec 02, 2019 3:39 pm, edited 1 time in total.
#827043
Hi,

You can change it like this:
Code: Select all
$caseId = @@APPLICATION;

$result = executeQuery("SELECT APP_NUMBER, APP_STATUS FROM APPLICATION WHERE APP_UID='$caseId'");
$caseNo = $result[1]['APP_NUMBER'];

executeQuery("DELETE FROM PMT_CLIENTS_LIST WHERE APP_UID='$caseId' ");

$rowNo = 1;
foreach( @=clientsList as $row ){
	$name = $row['name'];
	$address = $row['address'];
	$hasContract = $row['hasContract'];
	$query = "
		INSERT INTO PMT_CLIENTS_LIST (APP_UID, APP_NUMBER, ROW_NO, NAME, ADDRESS, HAS_CONTRACT)
		VALUES ('$caseId', '$caseNo', $rowNo, '$name', '$address', '$hasContract')
	";
	executeQuery($query);
	$rowNo++
}
https://www.youtube.com/channel/UCYiyz1 ... jMXodwH1iw
Thanks
#827086
Thanks for trying, programerboy. Your solution had the same effect.

I found the cause. One of the fields was designated as a Primary Key and it was unable to add additional records. The front end interface didn't show anything about a PK in place. I modified it through the backend and removed the primary key and the rest of the records were then allowed to be added.

I think newer versions lets you designate the PK from the front end.

Hi, In order to delete a case you can follow the[…]

Hi. Have you tried to use JavaScript on your Dyn[…]

Hi Please, could you send information about the c[…]

Dashboard issue

Can you show me what you were trying to do in orde[…]