Questions and discussion about using ProcessMaker: user interface, running cases & functionality

Moderator: amosbatto

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.
Cannot upload CSV

Hi, I am using a multi-file upload. When I upload[…]

A Beginner's Guide for ProcessMaker

I recently completed a book on ProcessMaker - &q[…]

Hi guys. I am a newbie. I don't know how to upgrad[…]

HI Thanks so much! This is just what I need.