Track duration of Business Process Flow stages - No Code
Business Process Flows are a great tool for businesses to help users. They can guide users through a process, collecting information and ensuring all information is captured at the right point. There is no built in mechanism which tracks the duration the a record has been in a specific stage of the Business Process Flow. Luckily, you can build one.
To start with, we need to create a new entity, this entity, make it organisation owned and then save it. Nothing fancy needed, just an entity, make sure duplicate detection is turned off. Next we want to create a series of fields.
Record lookup - A lookup to the entity you want to record the time in the BPF Stage.
Stage Entry - Date and Time field for when the record entered the specific Stage.
Stage Exit - Date and Time field for when the record exited the specific Stage.
Duration - Whole number calculated field, showing the Diff in Days between Stage Entry and Stage Exit.
Primary Name - Name of the records.
Once all the fields are created, put them on a form and it should look something like this.
Save and publish the changes.
Next, we want to create a workflow. The workflow will be created against the entity the Business Process Flow entity itself...wait, what? Yes, so if you haven’t looked into it recently, there have been some changes to Business Process Flows which means they exist as their own entities now.
We want the workflow to trigger on change of Active stage or Status and when it does, we want to create the new custom entity we just built.
We want to set the following fields
The Business Process Flow entity contains a field called “Active Stage Started On” and as the Workflow will fire on change of status or active stage, the execution time of the process will be used as the Stage Exit.
The Primary Name is the name of the stage in the BPF, this is used later on.
All this is great, but it doesn’t make it easy for reporting, as you have to count up each of these records, relating to the record you want to see how long it’s been in a stage for. To make this easier, we can create a few rollup fields on the entity we are measuring.
Create fields for each one of the stages N.b you can only have a maximum of 10 roll up fields per entity. Make each field a whole number field and then make it a rollup field. In the roll up rules, you want to count based on the Primary Name (Name of BPF stage) we populated in the Workflow.
Why create Rollup fields? Well, in a perfect world, users will move only in a single direction in a BPF, but in the real world, users may go back and forth between stages. The Rollup field allows you to count up all records created for that stage and therefore, their duration.
There you have it, a mechanism to record how long a record in in a certain BPF stages, it’s super simple with just a custom entity, Workflow and Rollup fields. #nocode4life
Ciao for now!