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.
#787174
Create a trigger which is set to execute after the DynaForm. If you are using an external database, then create a Database Connection to the database, then copy the UID for the database and use it in your code. If using a PM Table to store the data, then you don't need a Database Connection. Then use this trigger code:
Change the variables to match the variables associated with in your DynaForm fields:
Code: Select all
$db = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXX'; //set to the UID of your DB Connection
$Days = @@Days;  
$DaysTaken = @@DaysTaken; 
$Comments = mysql_real_escape_string(@@Comments);
$sql = "INSERT INTO TABLE_X (DAYS, DAYS_TAKEN, COMMENTS) VALUES ($Days, $DaysTaken, '$Comments')";
@@result = executeQuery($sql, $db);
See: http://wiki.processmaker.com/3.0/Proces ... uery.28.29
#787202
Hi LouisLO,

Basically you didn't create a trigger you made some mistake in your variable creation.
If you are going to insert it in a Mysql database(internal, external)
Here is some clarification on how you do it.
1.) Establish db connection
db.PNG
db.PNG (81.43 KiB) Viewed 6452 times
2.) Your variable should just hold a string value
stuff_id.PNG
stuff_id.PNG (27.12 KiB) Viewed 6452 times
3.) Create a trigger, you can modify my code ( I named my trigger "get_db")
trigger.PNG
trigger.PNG (105.86 KiB) Viewed 6452 times
4.) Right click the task and go to steps and assign the trigger after routing
assign trigger.PNG
assign trigger.PNG (106.3 KiB) Viewed 6452 times
There is also other way to record pm data into a mysql table, it's going to a report table, read this if interested.
http://wiki.processmaker.com/3.0/Report_Tables
I hope this helps
#789652
michaeltimoteo wrote:Hi LouisLO,

Basically you didn't create a trigger you made some mistake in your variable creation.
If you are going to insert it in a Mysql database(internal, external)
Here is some clarification on how you do it.
1.) Establish db connection
db.PNG
2.) Your variable should just hold a string value
stuff_id.PNG
3.) Create a trigger, you can modify my code ( I named my trigger "get_db")
trigger.PNG
4.) Right click the task and go to steps and assign the trigger after routing
assign trigger.PNG
There is also other way to record pm data into a mysql table, it's going to a report table, read this if interested.
http://wiki.processmaker.com/3.0/Report_Tables
I hope this helps

can you share attachted files again "michaeltimoteo"? they are not available to download.

Being the best in the started business is the obje[…]

Winzo is a popular and unique game on the mobile p[…]

Cannot create process using templets

Real details. The problem was solved by effect!

However, it is essential to use it responsibly and[…]