Spring '20 Release Highlights: URL Hacks are Back!
Posted on January 29, 2020 (Last modified on December 10, 2024) • 3 min read • 558 wordsSpring is the season of rebirth. The barren wastes of Winter begin to be punctuated by stalks of new growth, the monochrome horizon broken by flashes of color and life as the world warms
Spring is the season of rebirth. The barren wastes of Winter begin to be punctuated by stalks of new growth, the monochrome horizon broken by flashes of color and life as the world warms and returns to a more comfortable axial orientation.
And that seasonal rejuvenation isn’t limited to cuddly critters and colorful blooms, it also affects our Salesforce orgs. That’s right, the Spring ’20 release is almost thawed out and ready for production!
In today’s post we’ll continue our stroll through the release notes with a look at a much-missed feature making its triumphant return from hibernation — URL hacks are back!
Let’s take a look.
A long time ago, in the days before Lightning Experience, before Classic was called “Classic”, adventurous admins practiced a now-almost-forgotten art. Evidence of these ancient magicks can still be found on the web. In the trailblazer community you’ll find old posts packed with potent phrases like “custom buttons” and “url hacks”, abandoned blogs still tell tales of saving users hours of data-entry time with “one simple trick”, and any gathering of well-worn admins will usually involve at least one wistful round of “remember the days when…?”.
But, eventually, new releases rendered the old ways ineffective. As the platform modernized, the Lightning Experience, and Flows, and Process Builder replaced the need for custom buttons and url hacks. And while, in many ways, that was an improvement — there were still those who looked longingly at their, now unused, custom buttons and remembered a time when they had wielded the power of gods.
The good news for them is, those times are coming back!
The short and sweet version is that Salesforce (pre-Lightning) used to keep a bit more of the “behind the scenes” action visible in the URL bar.
See all that stuff at the end of the URL after the “&”? That’s URL magic passing extra information to Salesforce about what to do once it lands on the page. And, because of that, if you knew how Salesforce responded to specific URL additions, you could do some pretty special things, like pre-populate records with information when you created them!
Basically, instead of asking users to click the standard “Create New” button to produce a blank new record they’d need to fill in from scratch, you could use a custom button to simultaneously create a new record and also pass in information like the Account Name, number of employees, Owner ID, etc… to save your users some keyboard time! All you had to do was point the custom button to the URL you made with all that extra information baked in.
The Spring ’20 release notes even have the new tricks mapped out for you, so there’s no more need for admins to guess, check, and decode the URLs to find the secret sauce. Simply construct a custom button or a link that launches a new record and use the sample formula to prep-populate your field values!
/lightning/o/Account/new?defaultFieldValues=
Name={!URLENCODE(Account.Name)},
OwnerId={!Account.OwnerId},
AccountNumber={!Account.AccountNumber},
NumberOfEmployees=35000,
CustomCheckbox__c={!IF(Account.SomeCheckbox__c, true, false)}
We weren’t the only ones excited either.
All that’s left to do is decide how you’ll use your newfound power!
Until then, keep working hard, smart, and happy! And we’ll see you in the cloud.