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.
#787551
Create a trigger and use executeQuery() to populate the grid. Create a grid variable named "staffList", Then create a grid associated with that variable in a DynaForm. Put two textboxes in that grid which have the IDs "staffId" and "staffName". Then create a trigger with the following code:
Code: Select all
//if using an Database Connection to an external database:
db = 'XXXXXXXXXXXXXXXXXX'; //set to unique ID of your Database Connection
@=staffList = executeQuery("SELECT STAFF_ID AS staffId, STAFF_NAME AS staffName FROM STAFF", $db);
See:
http://wiki.processmaker.com/3.0/Grid_C ... base_Query
http://wiki.processmaker.com/index.php/ ... base_Query
http://wiki.processmaker.com/3.0/Proces ... uery.28.29
#787603
Dear Amosbatto,

It works. Many thanks!

Louis



amosbatto wrote:Create a trigger and use executeQuery() to populate the grid. Create a grid variable named "staffList", Then create a grid associated with that variable in a DynaForm. Put two textboxes in that grid which have the IDs "staffId" and "staffName". Then create a trigger with the following code:
Code: Select all
//if using an Database Connection to an external database:
db = 'XXXXXXXXXXXXXXXXXX'; //set to unique ID of your Database Connection
@=staffList = executeQuery("SELECT STAFF_ID AS staffId, STAFF_NAME AS staffName FROM STAFF", $db);
See:
http://wiki.processmaker.com/3.0/Grid_C ... base_Query
http://wiki.processmaker.com/index.php/ ... base_Query
http://wiki.processmaker.com/3.0/Proces ... uery.28.29
#787839
DanDan, the names of the fields in your SQL query need to match the IDs of the fields inside the grid. You probably need to use "AS" to rename the fields.

For example, if you have a grid associated with the variable "clientsList" and inside your grid you have the fields with the IDs "firstName", "lastName" and "address", then your SQL query in the trigger needs to be:
$db = 'XXXXXXXXXXXXXXXXXXXXXXXXX';
Code: Select all
$sql = "SELECT FIRSTNAME AS firstName, LASTNAME AS lastName, CLIENT_ADDRESS AS address
   from CLIENTS WHERE GROUP='local clients' ";
@=clientsList = executeQuery($sql, $db);
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[…]