Questions and discussion about using ProcessMaker: user interface, running cases & functionality
By heemalkumar
#825465
Hi All,
I have a form which we have built, where form is raised by Human Resources (HR), who sends form to IT for deletion of system access of an employee. Once IT actions this request, I want the form to route directly to the Manager of the employee.

How can I do this, that when HR initiates the case, they enter the Manager's user, hence when IT submits form, case goes to Manager directly.
User avatar
By amosbatto
#825470
Let's say that you have a dropdown with the ID "selectUser" with the following SQL:
SELECT USR_UID, CONCAT(USR_FIRSTNAME, ' ', USR_LASTNAME, ' (', USR_USERNAME, ')') FROM USERS

Then in a trigger fired after the Dynaform containing that dropdown, you can use this PHP code:
Code: Select all
if (!empty(@@selectUser)) {
    $aUserInfo = userInfo(@@selectUser);
    @@managerId = $aUserInfo['reportsto'];
     if (empty(@@managerId)) {
        throw new Exception("User {$aUserInfo['username']} is not assigned to a department or has no manager in department");
     }
}

Then, set the task which should be assigned to the manager to use Value Based Assignment and set its variable to be: @@managerId

Remember to add all the managers to that task's assignment list.

Get an instant solution to move emails to MBOX for[…]

Most Demanding OST to PST Converter

The most demanding OST to PST Converter is TrijaT[…]

Betvisa clone scripts are pre-built software solut[…]

A Bet365 Clone Script is essentially a ready-made […]