Share ideas, ask questions, and get feedback about developing for ProcessMaker
Forum rules: Please post new questions under "Developing processes & programming" for ProcessMaker 2 or 3.
User avatar
By amosbatto
#789496
What you have to do is create a trigger in one of your processes, with code like this:
Code: Select all
$db = 'XXXXXXXXXXXXXXXXXXXXXX'; //set to ID of your database connection to a MSSQL database
//assign to a normal PHP variable to insert in the query
$fieldB = @@fieldB; 
//remove single quotation marks around '$fieldB' if FIELDB is a number field
$sql = "SELECT FIELDX, FIELDY, FIELDZ FROM TABLEA WHERE FIELDB='$fieldB' ORDER BY FIELDX";
@=dbResult = executeQuery($sql, $db);
(Note: This trigger doesn't need to be set to fire in a step in the process.)

In your web services script, call the sendVariables() web service to set the value of fieldB. Then, call executeTrigger() to fire the trigger. Then, call getVariables() to get the value of dbResult, which should have a format like this:
Code: Select all
array(
   '1' => array( 'FIELDX' => 'valuex', 'FIELDY' => 'valuey', 'FIELDZ' => 'valuez'),
   '2' => array( 'FIELDX' => 'valuex', 'FIELDY' => 'valuey', 'FIELDZ' => 'valuez'),
   '3' => array( 'FIELDX' => 'valuex', 'FIELDY' => 'valuey', 'FIELDZ' => 'valuez')
)

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[…]