Unable to cancel Leave Application After Submit

Hi there,
I am have created a custom workflow and I am trying to achieve is that after approving a leave application in case if the leave application must be cancelled it should be cancelled. But i am unable to perform or change that i have even tried to change the permissions of the leave application but whenever i try to save the change it reverts back to the previous save though not raising any errors.
To be more specific I have an HR manager who can cancel an application even after approving at first so in leave application i try to change the permission for docstatus to 1 and approving what all activities he can perform i.e. i checked box for read write delete submit cancel amend but when i try to save it reverts back to just read write what may be wrong let me know.!

@Ujjawal

If you are using workflow then you have add State for Cancel with Doc Status 2.

Hi @Ujjawal! Can you please share a screenshot of your workflow setting? Thanks! You can also check this video for a step b step process in creating workflows. Thanks!

Dory,
https://bai.ph/

Hi @creamdory,
My workflow is as follows:

And i have created workflow by taking guidance from that video it self.!
Let me know my error.

@Ujjawal
You have to just add one more State. See below screenshot.

Add this in your workflow.

Hi @Ujjawal! You actually have to define “Cancel” in your “States” table with DocStaus = 2. Also, you need to define it in your Transition Rules. Please see below:

Hope this helps!

I am trying t change the permissions for HR Manager but still unable to…
I ll attach an image of my workflow too.

I did as above.

@Ujjawal Try changing it in the Role Permission Manager instead.

I have done that already.!
Still no Luck!

@Ujjawal

Please check the flow. Can you see Cancel option Under action Button after Approved State?

No there’s no action button once the leave is submitted.

Hi @Ujjawal

Please try changing the flow to this:

@Ujjawal

your current workflow state is Approved By HR. But I didn’t see it in your previous screenshot. Have you changed anything in Transaction Rule table? Also, check whether login user has HR Manager Role.

The login user is Admin and it has all the roles assigned.
What about the transaction rule table.?

How can i set a state to approved if i haven’t assigned it to state table.

Sorry it was a typo. Rejected > Approve > Approve by HR

I think under rejected state approved by hr state will come as i want to cancel a leave after its being approved.

Well after Your suggested changes i am unable to reject an application once it comes approval/Rejection stage

Hi @Ujjawal please see this change:

You can also make necessary changes according to how you would like it. So far, this is how the jest of it. You can try experimenting with the flow too. Thanks!