Home » Resources

Blog

Solving Business Challenges: Business Hours

We’re problem solvers at ThirdEye, and we’ve created unique solutions for the most challenging of obstacles. So when Crunch Accounting called upon us to help them improve their SLA tracking, we got to work. Here’s what we did.

Salesforce’s ‘Business Hour’ functionality has helped numerous companies better meet customer expectations by more accurately calculating and tracking progress against SLAs. This functionality is a giant step forward, particularly for long-time Salesforce users who previously had to wrestle with complex formulas to determine if a case was within SLA times. Unfortunately for one of our clients, unlocking those powerful calculations on custom objects still requires the use of Apex to call the Business Hours class.

Crunch Accounting strives for excellence in every aspect of their business, and one of their major goals was to better track against the SLA goals for their accounting team. As the accounting team managed their work through a custom ‘Accounting Services’ object, we knew we’d have to write some code – but we wanted to adhere to our low-code design principles and give them a flexible tool to use across their business as new problems arose. Instead of writing a trigger, we wrote an Invocable Apex Class that unlocks the Salesforce Business Hour functionality within Flow – making it accessible for any object and any use case.

To do this, we simply created a ‘Business Hours Request’ (BHR__c) sObject with a picklist for the method type, a picklist for the different Business Hours configurations and some inputs and output fields for each method. For example – for the ‘Add’ method we have an Input Date/Time, Input Number of Hours, Input Number of Milliseconds [formula field] and an Output Date/Time).

From there, we simply use a flow assignment to set the right values on a record variable which is passed to the Invocable Apex and is returned with the desired output – all without actually performing a DML statement. During bulk stress testing, this solution achieved similar (and in some cases faster) performance than applying the same logic in a trigger calling the Business Hours class. Now, Crunch or any other of our clients can leverage the Business Hours capability anywhere they like without writing a single line of new code.

This flow uses the invocable class to stamp three different SLA target thresholds onto a record. This allows Crunch to achieve greater visibility for how they achieve against their public SLA and against their increasing performance targets. These performance targets are made achievable through other efficiency gains through Salesforce. The flow works quickly, even when calculating all three targets for 200 records at a time.

Back to all resources
Top Get in touch

Find out how ThirdEye can help your company to succeed

Communication:

Sign up to receive marketing updates and news from ThirdEye Consulting:
We’d like to keep in touch with you with news and updates about ThirdEye Consulting and the innovative work we are doing.
We will never sell your data and we promise to keep your details safe and secure.
You can change your mind at any time by emailing contact@thirdeyeconsulting.co.uk.

Follow us:

Interested in being part of the ThirdEye's team?

Communication:

Sign up to receive marketing updates and news from ThirdEye Consulting:
We’d like to keep in touch with you with news and updates about ThirdEye Consulting and the innovative work we are doing.
We will never sell your data and we promise to keep your details safe and secure.
You can change your mind at any time by emailing contact@thirdeyeconsulting.co.uk.

Follow us:

By clicking "Accept All Cookies", you agree to the storing of cookies on your device to enhance site navigation, analyse site usage, assist in our marketing efforts, and for personalised advertising.

More Information Accept All Cookies