ERPNext.com Frappe Cloud Support Partners Foundation Frappe School

Adding workflow on employee creation

Is it possible to add a workflow for creating an Employee?
If yes, can some please advise me on how to do it?

I want the HR User to type in the employee details while the HR Manager reviews it before Saving it since it’s not a submittable doctype.

I tried this workflow shown in the pix and tried creating an employee using HR User, the employee SAVED even before the HR Manager can see it.

That is as intended. Workflows don’t prevent documents from saving. Until a document is saved, none of the data is persisted in the system.

I’m not sure exactly what you’re trying to do, but are you looking perhaps for a way to control when an employee’s status is set to “Active”? For that, you can set that field to read-only using Customize Form and then update the value directly from the workflow (using the Update Value field shown in your image above).

Thank you Peter,

Your idea actually brought me closer to solving the problem.

Yes, what I wanted to achieve is to make sure that accurate employee bio data is captured in the system, so I planned to have a staff type in the details,while a senior staff verifies the details before saving it.

But since every document must be Saved first before any other thing, I think your suggestion is a good alternative.

But what if an Active employee needs to update some of his personal details (Change home address or Update his academic qualifications). I still want someone to verify those update. Is it still possible to control this bio-data update when the employee is already active in the system?

Can a workflow do that as well?

That’s not possible out of the box, and it’d be a bit tricky to set up. Structurally, the problem is that Frappe doesn’t provide any way to maintain “temporary” values in parallel with active stored values.

I can think of a few different ways to achieve this, depending on your goals and most typical use. If you just need to update a few fields occasionally, you could create a new doctype called “Amendment Request”, or something similar, and give employees the capacity to create them but only managers the ability to approve them. Alternately, you could allow employees to duplicate the original doc in an inactive state, give them the rights to edit, and then allow a manager to fold the changes back into the original. Both would require a fair bit of scripting, and the best option depends mostly on how significant the changes tend to be in any given instance.

Thank you. sir.