Workflow Series II
Hi Readers,
For our workflow series II, we will work with the scenario below
Approvers | Scenario |
Approver 1 | Either can approve |
Approver 2 | |
Approver 3 | Either can approve |
Approver 4 | |
Approver 5 |
For the first post in the series you can check - Workflow Series I
I have set up my workflow user group as below
As the initial setups were explained in the first setup, i will directly go to the changes you can make in your workflow to accomodate such a setup.
In the approval entries, we have two hidden fileds that will help us with this scenario : Number of Approved Requests and Number of Rejected Requests.
I have setup the workflow I will use as below
The purchase invoice is created.
An approval is sent and the approval entries are as below.
After the first approver by sequence 1 , the approval entries are update to look like below.
After the first approver by sequence 2 , the approval entries are update to look like below.
Similar to our first scenario, we will face challenges with the standard setup:
- After the second approval, the status of some approval entries remain open
- The status of the document remains Pending Approval
Fix 1: Sorting the approval entries
We will make a change in the line below in the workflow. That particular line is the one which triggers the final approval of the record.
We will add the filters below
Let me explain the filters
Filter | Filter Value | Explanation |
Pending Approvals | Blank |
In a standard sequential workflow, it is assumed that each person in the chain approves the document. Therefore, the pending approvals will be 0 after all aproovers are done. In our case, we only require 2 approvers out of a pool of 5 approval entries. So we need to remove this filter and leave it blank. |
Number of Approved Requests | >1 |
Each time a request is approved, this field is updated. Once any approver with sequence number 1 approves the record, the field will be updated with 1. A request is sent to the sequence 2 approvers. Once the approver with sequence number 2 approves the record, the field will be updated with 2. Therefore, we need the approved requests to be greater than 1 signifying that a single user from sequence 1 has approved the record |
Sequence No | 2 |
This indicate the sequence number of the user approving the record. We use this filter to ensure that the ability to fully approve the record is triggered by a user from the sequence 2 pool. Even if 2 users from the sequence pool of 1 both approve the record, it will have not effect on the record. |
Fix 2 : Sorting the Approval Entries once a manager approvers
This will be similar to Workflow series 1.
Click on the responses to the second line as shown below
In the window that appears , add a response called 'Approve the approval request for the record' as shown below
This response will change all the approval entries to Status Approved if any manager approves the record.
Lets retest our approval again
Approval Entries after first approval :
Approval Entries after second approval:
The document is also released.
You can also check which approvers from the pool approved the record using the Last Modifed By and Last Modified Date.
That marks the end of the post.