Page 1 of 1

Trigger set before load of a Dynaform fails

Posted: Wed Aug 26, 2020 2:16 pm
by rmanavalan
I could see the following error in console:
GET http://bpm.monkeycap.com/sysworkflow/en/neoclassic/cases/cases_Step?TYPE=DYNAFORM&UID=3118538615f3f326a3e2148090801994&POSITION=1&ACTION=EDIT 500 (Internal Server Error)

My trigger code was originally this (based on the example given in wiki):
$groupName = "Project Mgmt";
$groupId = PMFGetGroupUID($groupName);
if (empty($groupId)) {
throw new Exception("Group '$groupName' doesn't exist.");
}
$aUsers = PMFGetGroupUsers($groupId);
@=availableUsers = array();

foreach ($aUsers as $aUser) {
$fullName = $aUser['USR_FIRSTNAME'] .' '. $aUser['USR_LASTNAME'];
@=availableUsers[] = array($aUser['USR_UID'], $fullName);
}

The above failed. So, i started removing a few lines to isolate the error.

when I had just the two below, it worked:
$groupName = "Project Mgmt";
$groupId = PMFGetGroupUID($groupName);

However, when I added the other lines, it failed.

Also, just having the line below also fails!
@=aUsers = PMFGetGroupUsers('4304671805f3f34ee637e20089977279');

The interesting part is that the trigger is executed during alternate times only. For example, I open the case, the trigger fails and a blank page is shown. I go to Home and open the case again, the form is displayed without the execution of trigger. I go to Home and open the case again, the trigger fails and a blank page is shown. It keeps alternating. Wondering what is the logic behind this...

Please help me fix the issue and also let me know the reason behind the alternating behavior! Thanks in advance.

I use 3.3.10-community.