- Wed Apr 25, 2018 9:32 pm
#814218
Hi folks,
I am trying to store the contents of checkgroup int a report table as described in http://wiki.processmaker.com/3.1/Report ... heckgroups
I am using Community 3.2.1
But am coming up with a problem which is probably easily solveable by someone who knows what they are doing (I'm a dwarf standing on the shoulders of giants).
I have a checkgroup field named aPSEDEducationFields. I am trying to write the contents into a column called FIELD in PMT_APSED_EDUCATION_FIELDS. I have a trigger (as per below) which is executed after the Dynaform.
However, when the trigger runs it only creates one row and writes the value of the first item.
cheers
Greg
I am trying to store the contents of checkgroup int a report table as described in http://wiki.processmaker.com/3.1/Report ... heckgroups
I am using Community 3.2.1
But am coming up with a problem which is probably easily solveable by someone who knows what they are doing (I'm a dwarf standing on the shoulders of giants).
I have a checkgroup field named aPSEDEducationFields. I am trying to write the contents into a column called FIELD in PMT_APSED_EDUCATION_FIELDS. I have a trigger (as per below) which is executed after the Dynaform.
However, when the trigger runs it only creates one row and writes the value of the first item.
Code: Select all
All assistance is greatly appreciated.$caseId = @@APPLICATION;
//look up the case number (and case status if needed):
$result = executeQuery("SELECT APP_NUMBER, APP_STATUS FROM APPLICATION WHERE APP_UID='$caseId'");
$caseNo = $result[1]['APP_NUMBER'];
//first delete all existing records from this case, if updating:
executeQuery("DELETE FROM PMT_APSED_EDUCATION_FIELDS WHERE APP_UID='$caseId' ");
//then insert a new record for each row in the "aPSEDEducationFields" checkgroup
for ($rowNo = 0; $rowNo < count(@=aPSEDEducationFields); $rowNo++) {
$field = @=aPSEDEducationFields[$rowNo];
$query = "INSERT INTO PMT_APSED_EDUCATION_FIELDS (APP_UID, APP_NUMBER, ROW_NO, FIELD)
VALUES ('$caseId', '$caseNo', '$rowNo', '$field')";
executeQuery($query);
}
cheers
Greg