Tip #31: Track delays and capture causes for delay using Client Scripts in Qntrl

Tip #31: Track delays and capture causes for delay using Client Scripts in Qntrl



Overcoming project delays is a major concern for many businesses. Most industries like IT, manufacturing, transport, and construction work on defined time lines and any delay in completion might lead to cost overrun, compromised reputation, or even failed projects. To overcome this, monitoring instances of delay regularly, right from the initial phases of a project is essential.
 
Automating delay management is a recommended step as it eases central monitoring and reduces errors. To automate delay monitoring, Qntrl supports SLAs for every single stage. But, if you want to track time delays beyond individual stages—for a group of stages or an entire card—Client Scripts can be of help.
 
Client Scripts are coded by users to process existing data or add additional validations to data available in Qntrl. Let us now calculate the time delay using Client Scripts.
 
Business case
Donelly Constructions uses Qntrl to track the progress of their construction activities. They require to calculate the time difference between 2 given transitions to monitor the delay. If the calculated time limit is higher than 72 hours, the field ‘Reason for delay’ must be mandated to be filled by the user while closing the card.

Solution
  • Create a form with 2 Date & Time fields.
  • Configure the blueprint transition’s After section with Update Fields to capture the time at which the transitions take place.
  • Code the Client Script to calculate the time difference between 2 transitions and if any delay is spotted, prompt the user to provide the reason for delay while performing the last transition.  

Sample configuration

Step 1: Create 2 Date & Time fields in forms to capture the completion time of transitions.
  • Here, 'Time of milling' and 'Time of testing' are the 2 fields used.
  • Turn off the visibility of these fields to restrict users from filling them during card creation.


Step 2: Record the exact completion time of transitions using Update Fields in Blueprints or Business Rules.
  • In the blueprint, configure the 2 transitions you want to find the time difference between with Update Fields in After section.
    • Note: Any 2 transitions other than the last transition can be configured here.
  • Set the action as ‘Time of milling’ = ‘Execution date’ and ‘Time of testing’ = ‘Execution date’.

  • In the final transition, configure During section with fields ‘Time of milling’, ‘Time of testing’, and ‘Reason for delay’ to prompt the user while closing the card.


Step 3: Find the time difference between 2 date and time fields,  Identify delay, and hold accountability using Client Scripts.

Configure the client script for the last transition with execution trigger as OnLoad.


  1. async function onLoad(forpage) {
  2.     //You can lock the fields to restrict users from changing the time value
  3.     current.Layout.Fields.<select-first-date-field-here> .lock();
  4.     current.Layout.Fields. <select-second-date-field-here> .lock();
  5.     var request_time = current.Job.getValue(current.Blueprint.Transition.Fields. <select-first-date-field-here> .id);
  6.     var finished_time = current.Job.getValue(current.Blueprint.Transition.Fields. <select-second-date-field-here> .id);
  7.     //Calculating the time difference and validate it
  8.         var difference = (finished_time.value - request_time.value) / (1000 * 60 * 60)
  9.         if (difference >= 72) {
  10.             current.Blueprint.Transition.Fields.<select-reason-for-delay-field-here>.setMandatory(true);
  11.             current.Blueprint.Transition.Fields. <select-reason-for-delay-field-here> .show();
  12.         } else {
  13.             current.Blueprint.Transition.Fields. <select-reason-for-delay-field-here> .hide();
  14.         }   
  15.     }




Here, when performing the final transition, if the time difference is greater than or equal to 72 hours, the field ‘Reason for delay’ is set to mandatory. Else, if the time difference is less than 72 hours, the field will not be prompted for the user.  



Let us know if this business case is useful for you. You can view more such sample client scripts in our KB. If you have any unique requirements, comment below or email us at support@qntrl.com.





                            Zoho Desk Resources

                            • Desk Community Learning Series


                            • Digest


                            • Functions


                            • Meetups


                            • Kbase


                            • Resources


                            • Glossary


                            • Desk Marketplace


                            • MVP Corner


                            • Word of the Day



                                Zoho Marketing Automation
                                        • Sticky Posts

                                        • Tip #21: Increase user engagement using dynamic email content and attachments in Orchestly

                                          Businesses often send out bulk emails like weekly newsletters, monthly event updates, promotional emails, surveys, beta access emails, product reviews, seasonal greetings, and so on. Even as the gist of these emails remain constant for all recipients, personalizations capture the audience’s attention and help brands connect with them.   Orchestly’s email templates allows you to draft and send dynamic emails with personalized content and attachments to internal and external users. Email templates
                                        • Qntrl's 2023 year in review

                                          This year has been all about analyzing our customer feedback and building a resilient and solution-driven product from it. As a result of this work, we're happy to announce that a whole new version of Qntrl is getting ready for release soon. This new
                                        • Tip #61: 5 different ways to create Cards in Qntrl

                                          Qntrl supports an array of features that covers everything required for business orchestration, from process automation to business advancement. Cards, being the elemental feature of Qntrl, record all the details of a particular task from the beginning
                                        • Tip #17: Stay informed of significant business impact using Orchestly

                                          With remote working becoming the new norm, leaders across sectors need to stay updated of their business performance in the market to aid business decisions. Instead of awaiting virtual meetings from sales and finance heads to put forth the business status, organization leaders can themselves dig into the system to keep an eye on their revenue generating customers or set up notifications to monitor major updates.   Orchestly recognizes such requirements and provides adaptable solutions for all business
                                        • Onboard faster with Orchestly's Tutorials

                                          We are actively rolling out new learning materials to assist our customers onboard at ease and automate their processes effortlessly. On that front, we recently launched Tutorials for Orchestly.   Tutorial is a step-by-step guide to help users familiarize the concepts of Orchestly and automate simple processes right from scratch. We’ve documented 3 such business processes viz. Order Manufacturing, Product Implementation, and Change Management.   We're looking forward to document more customer-centric


                                        Manage your brands on social media



                                              Zoho TeamInbox Resources

                                                Zoho DataPrep Resources



                                                  Zoho CRM Plus Resources

                                                    Zoho Books Resources


                                                      Zoho Subscriptions Resources

                                                        Zoho Projects Resources


                                                          Zoho Sprints Resources


                                                            Qntrl Resources


                                                              Zoho Creator Resources


                                                                Zoho WorkDrive Resources



                                                                  Zoho Campaigns Resources

                                                                    Zoho CRM Resources

                                                                    • CRM Community Learning Series

                                                                      CRM Community Learning Series


                                                                    • Tips

                                                                      Tips

                                                                    • Functions

                                                                      Functions

                                                                    • Meetups

                                                                      Meetups

                                                                    • Kbase

                                                                      Kbase

                                                                    • Resources

                                                                      Resources

                                                                    • Digest

                                                                      Digest

                                                                    • CRM Marketplace

                                                                      CRM Marketplace

                                                                    • MVP Corner

                                                                      MVP Corner

                                                                    





                                                                    




                                                                        Design. Discuss. Deliver.

                                                                        Create visually engaging stories with Zoho Show.

                                                                        Get Started Now