Questions and discussion about using ProcessMaker: user interface, running cases & functionality
#813713
Hi Team
I would like to prevent users to be able to send a form to themselves for approval.
How do I do this?

Unfortunately, they are Managers, and they need to send their forms to their Unit Heads for approval.
#813716
There are two ways to do this.
One way is to create a department with the people who will be assigned to the current task and the manager of the department will be assigned to the next task in the process. Then give your next task the Reports To assignment rule. Then assign the managers to the current task and the unit head to the next task.
(You might have problems with this solution if you are already using departments for another purpose, since users can only be assigned to one department.)

The second way is to use Value Based Assignment in the next task. Here are the steps:
1. Place all the users assigned to the next task in a group named "Approval Group".

2. Add a dropdown in a DynaForm in the current task which is associated with the "approvalAssignedUser" variable. This dropdown will allow the current user to select the user assigned to the next task, but it won't have the current user in the list of options.

3. Set the data source property of this dropdown to "array variable" and set the array variable property to: @@availableUsers

4. Create the following trigger to populate the list of options in the dropdown box:
Code: Select all
$groupName = "Approval Group";
$groupId = PMFGetGroupUID($groupName);
if (empty($groupId)) { 
    throw new Exception("Group '$groupName' doesn't exist."); 
}
$aUsers = PMFGetGroupUsers($groupId);
@=availableUsers = array(); 

foreach ($aUsers as $aUser) {
    if ($aUser['USR_UID'] != @@USER_LOGGED) {
        $fullName = $aUser['USR_FIRSTNAME'] .' '. $aUser['USR_LASTNAME'];
        @=availableUsers[] = array($aUser['USR_UID'], $fullName);
    }
} 
Set this trigger to fire before the Dynaform containing the "approvalAssignedUser" dropdown.

5. Set the next task to use Value Based Assignment and set its variable to be: @@approvalAssignedUser
Want to create your own meme coin?

In the world of cryptocurrencies, a unique and exc[…]

The market for cryptocurrencies is demonstrating a[…]

What's SAP FICO?

Embarking on a dissertation can be one of the most[…]

Hello. For rental housing, there are software solu[…]