ERPNext Conference 2019* ERPNext.com Blog

Workflow Customization


#1

Hello everyone, I want to create a custom workflow process for employee loan application whereby only a user that the applying employee reports to will be able to approve the application and move it along the workflow chain, currently workflow is by defined by role, i want to make it accessible to specific users.
Any help will be appreciated.


#2

@Ebuka_Joseph_Akeru sounds like you’ve already read the docs and this should be a repeatable on any instance. Can you screen shot what you’ve tried and I’ll try to repeat it locally? Please don’t share actual employee names or loan amounts.


#3

Thanks @tmatteson


Employee loan application,

Workflow showing transition states

HR manager users
I want to create a situation where Employee 2 (who employee 1 reports to) will receive an email notification and employee 3 will not.


#4

Some vanilla ideas to try:

  1. Can Employee Two be an HR User but not an HR Manager? If that works for you, you’ll want to add that as a possible path in your workflow (so that both HR user and HR Manager can approve loans)
  2. I’m pretty sure you want a save and submit step so that an employee can come back to their loan application mid process if needed
  3. Be sure to add a canceled state so that the Employee or HR can cancel the loan application if needed.
  4. Consider adding a custom role for “Loan Approver” to separate this from other HR responsibilities, if that’s appropriate for your use case.
  5. The email notification you can set up with an email notification, though you may need to add a custom link field for user to the loan application. You could write a script that fetches the employee’s supervisor and populates their email into the custom field, but I think that’s probably not worth the effort.

#5

Can we consider the possibility of extending the workflow functionality to include both individual users as well as roles as recipients of workflow actions and then have the ability to use a variable to reference a field in the doctype that the workflow is being defined for? e.g. {doc.reports_to}


#6

Workflow Action is superb for remote approvals via email but currently, it is like a loose cannon! …Notifications are always getting sent to users who have no business with the document just because they have the same role as the creator and/or approver

It would be great to have this fixed!

Cheers


#7

How to set different workflows for different leave types and designations?


#8

I use custom field to manage this