The challenge
The process of becoming an affiliate partner of travel company Expedia ought to be as seamless as booking your holiday with them. However, with a number of approval gates to pass through and unnecessary human involvement leading to errors and slowdowns, new partner onboarding was often delayed and far from first class.
Our solution had to be scalable, provide a quick way of modifying approval criteria and action requests automatically when manual input wasn’t required.
Our response
In Salesforce, standard functionality satisfies the needs of most approval processes. But when multiple steps and frequent changes are involved, its limitations are exposed. Updating configurations consumes time, drains resources and hurts efficiency.
And where records can’t be automatically approved, despite only needing simple human cross-checks, it leads to mistakes and delays.
To solve these problems for Expedia, our development team first drew up a high-level architecture, including new custom objects, APEX classes and a Lightning Web Component.
One of our first key decisions was to make use of the standard approval request screen, giving manual users a familiar UI, while creating a generic process with disabled criteria that could only be entered via APEX.
That gave us greater control on when the process should be invoked and which users should be included as approvers, bypassing a Salesforce limitation and allowing us to make use of inbuilt approval history tracking.
For scalability, we chose to offload the processing into a batchable APEX class, which was invoked once all approval criteria had been entered into the custom object.
We used a JSON data structure to store and handle the data more efficiently, with no additional processing required.
The final piece of functionality was the ability for a pre-approved record to be handled automatically. While this could have been done in the APEX trigger, the use of a platform event ensured that approvals would be recorded correctly.
The outcome
Once the solution was agreed with the client, we set about developing, testing and finally releasing it into the production environment.
It was then incorporated into the client's main sales pipeline, where it is now contributing to considerable time savings and improved approval accuracy.
Dan Cartwright
Senior Software Engineer
@dac