Share ideas, ask questions, and get feedback about developing for ProcessMaker
Forum rules: Please post new questions under "Developing processes & programming" for ProcessMaker 2 or 3.
By crzaylife
#6143
Hi,
I want to create supplier maintenance process in ProcessMarker, the requestor submit supplier maintenance request at the beginning of process, then it need to approve by their department manager, but the request from each department, how to identify who is their manager and send the alert to manager to approve,thanks

second question is I want to list the approval name in the next process dynamicform to show the next approver that the last approve result, comments and approve name,how to get the last approval information? especially user account information,thanks
User avatar
By amosbatto
#6231
crzaylife wrote:I want to create supplier maintenance process in ProcessMarker, the requestor submit supplier maintenance request at the beginning of process, then it need to approve by their department manager, but the request from each department, how to identify who is their manager and send the alert to manager to approve,thanks
Currently ProcessMaker doesn't have hierarchy information about users. You will have to create an external database or PM table which has that sort of information about the users. Then use SQL statements to look up that info in triggers or with DynaForm fields. In the first quarter, a new field will be added to the information about users to select who that user reports to. (It is in the Development RoadMap under "Reporting Paths"). So it will be easier to look up one's supervisor in the future using the userInfo() function.

You can write a trigger which looks up the supervisor with executeQuery(), then use PMFSendMessage() to send that supervisor a message. If you want the supervisor to approve it by clicking a link in the email, see Example #3 for Web Services. If that is too complicated, just assign the supervisor to be the next assigned user for the next task in the process, so the supervisor will be forced to log in and approve or disapprove. To set the supervisor to be the next assigned user, use a variable based assignment. Right click on the next task in the process, then select "Properties" option from the dropdown menu. Go to the "Assignment Rules" tab, select "Value Based Assignment". Then in a trigger set the next assigned user to the UID of the supervisor:
@@SYS_NEXT_USER_TO_BE_ASSIGNED = $supervisorID
crzaylife wrote:second question is I want to list the approval name in the next process dynamicform to show the next approver that the last approve result, comments and approve name,how to get the last approval information? especially user account information,thanks
You can look up the user information with the userInfo() function in a trigger. To find out which user worked on a particular task in your process (i.e., which supervisor was logged in an approved the result), you can query the APP_DELEGATION table.

If you're looking to save big on your next online […]

If you're looking to save big on your next online […]

If you're looking to save big on your next online […]

Use the latest Freecash referral code "FC2507[…]