If you want to write to a PM Table, you need need to use the executeQuery("INSERT ...") function in a trigger, which is executed after the Dynaform. You PM Table needs to have unique field to identify each record (which is normally called something like "ID"). If you don't want to generate the ID, then set the field to autoincrement when defining the PM Table and you won't have to include the ID field in your INSERT statement. See:
https://wiki.processmaker.com/3.0/PM_Ta ... m_Triggers
If your PM Table is named PMT_PRODUCTS has the fields ID, PRODUCT_NAME, DESCRIPTION, PRICE and AMOUNT, where ID is autoincrement, then you don't have to include ID in your INSERT statement.
Your trigger code would be:
Code: Select allif (@@productName) {
//use mysql_real_escape_string() to prevent SQL code injection attacks
$name = mysql_real_escape_string(@@productName);
$desc = mysql_real_escape_string(@@description);
$price = @#price; //convert to float
$amount = @%amount; //convert to integer
//char and datetime values need to be enclosed in single quotation marks, but numbers do not:
$sql = "INSERT INTO PMT_PRODUCTS (PRODUCT_NAME, DESCRIPTION, PRICE, AMOUNT)
VALUES ('$name', '$desc', $price, $amount)";
executeQuery($sql);
}
Set this trigger to execute
after the Dynaform which contains fields associated with the "productName", "description", "price" and "amount" variables.