Questions and discussion about developing processes and programming in PHP, JavaScript, web services & REST API.
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://pmlearning.info
Thanks
Last edited by programerboy on Wed Apr 07, 2021 1:36 am, edited 1 time in total.
#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.
Want to create your own meme coin?

In the world of cryptocurrencies, a unique and exc[…]

The market for cryptocurrencies is demonstrating a[…]

What's SAP FICO?

Embarking on a dissertation can be one of the most[…]

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