Salesforce Winter ’22 Highlights for Developers

Share this article...

The Salesforce Winter ‘22 release is full of magic and goodies – especially for Salesforce Developers – with long-awaited functionality finally becoming available. 

I’ve taken a peek into Santa’s sleigh – also known as the release notes – to dig up the best gems we Salesforce Developers will enjoy. Here are my top 10 picks: 

“Salesforce”

1. Salesforce Functions: The End of Platform Limits

You’ve probably heard of Salesforce Functions, or one of its earlier names, at some point during the last few years. 

Salesforce Functions will combine the elasticity of Heroku with the power of Salesforce to provide us with a whole new paradigm of development. 

You can now write methods in Javascript, Typescript, or Java – and hopefully other Heroku-supported languages in the future – which easily integrate with your Salesforce data, and invoke them using Apex code.

This promises endless possibilities for functions that until now were blocked by the platform’s limits. Whether it’s handling large files, processing data on limitless scales, or creating services that can draw on more power during peak times, Salesforce Developers have a lot to look forward to. 

You can also, finally, make use of libraries that never existed for Apex, but do for other languages (zipping files, anyone?) without having to resort to third party APIs.

Whether it lives up to all the hype is something many of us are truly looking forward to seeing!

2. Lightning Web Security (Step Aside Lightning Locker!)

Lightning Web Security (beta) is set to replace Lightning Locker. 

If you haven’t heard of Lightning Locker, it’s the mechanism in Salesforce that blocks you from using global objects and wraps every single thing inside a secure proxy wrapper.

I call it ‘Marmite’ – some people love it for sandboxing components, while others hate how invasive it is. Love it or hate it, it deserves our attention (offer me a sandwich once the release is here to find out what I think of it!)

Lightning Web Security is a faster, more compatible mechanism that should keep your components separate without being ‘all in-your-face’ about it. 

Why is it important that we know about it while it’s still in beta? Because you want to make sure your applications are compatible with it before it is generally available. This kind of update has the potential to break existing code in a way that may not be trivial to fix. Any responsible developer would test it as early as possible.

3. Dynamic Interactions 

Dynamic Interactions have been making headlines for some time now. These allow your custom components to broadcast events that carry values, then have those values delivered to other components on the same Lightning page. For example, you might have a component that shows a list of top accounts – clicking on this account can broadcast an event, and another component on the same page can show all the recent opportunities related to it.

While broadcasting events between two components that do not share a parent isn’t groundbreaking by itself (after all, we could always use the Lightning Messaging Service to achieve this), what this feature does deliver, is the ability for administrators to configure which events affect which other components. This would allow interactivity between two components from different vendors that were otherwise not specifically designed to work with one another.

But honestly, at this point, it raises more questions than it answers, such as why is there JSON inside our XML?

4. Restriction Rules

Data access in Salesforce used to be such a simple matter 😉 You’d set up profiles to define the object-level permissions, then the role hierarchy to define which users can see which records. You’d go back to the profile because (oops) you forgot field-level security. Oh, and there’s sharing rules. And enterprise territory management – and account teams. Finally, if you had really complicated requirements, you’d opt to use Apex Sharing.

And somehow, this one user could see that contact they shouldn’t have…

Well, Salesforce has got a new data access control to throw into the mix: Restriction Rules. Restriction Rules turn the paradigm on its head by actively blocking a user from seeing certain records.

Up until now, the rule was that in order to see a record, something must grant you access to it. “Blocking” simply didn’t exist – it was simply not a user who was not granted access to the record. 

This is the first mechanism available on Salesforce that can block access to something the user otherwise has permission to see.

If you’ve been using Apex Sharing to get around some of the barriers around the sharing model, give restriction rules a look and see how they change things.

5. Einstein OCR Improvements

Salesforce is releasing some really cool toys for Einstein OCR (optical character recognition), such as the ability to extract text from photos and PDFs. 

What does this mean to you as a developer? It means that you can now build applications that read business cards, scan printed spreadsheets, or read a restaurant menu (as long as it’s in English). 

Previously you’d have to opt for third party APIs to perform these tasks, now they’re available right here on the Salesforce platform – so your data doesn’t need to make any insecure trips to other services.

Get it? “Einstein Vision”? I should have gone into comedy…

You can read about the OCR update here, but the real treasure trove of information can be found in the Einstein Developer Guide.

6. Experience Cloud: User-controlled Cookie Permissions

Do you remember the days before GDPR? You could click a link to an article and just read it, without a pop up asking for cookie permissions, like some kind of privacy-unaware savage. 

These days, every single website we visit asks us for our cookie preferences. And some, which I will not mention here, will continue to ask you on every single page visit. 

Whatever your personal feelings on the subject are, it’s still the law. 

Salesforce made it easier for us to implement cookie preferences with the new Cookie Consent module available for Aura and LWC! This module allows a user to set which category of cookies they want to allow, and you, as a developer can check these choices when building your functionality.

7. Secure Static Resources Release Update Postponed

Previously, Salesforce had announced that they will be changing the domain from which static resources will be served. 

Developers were required to review any use of static resources with this update enabled and, in many cases, found that these files could not be loaded with standard lightning component functions such as loadScript().

If you, like myself, have been having recurring nightmares about this update, then relax! The serving of static resources will remain as-is until they figure out a way to keep it compatible with all the fantastic components that we’ve brought to the ecosystem.

8. First Generation Managed Packages to 2GP Conversion

While still in developer preview, Salesforce will be accepting more partners into the program for converting first generation managed packages. 

As 2GP evolves, its set of features begins to eclipse standard managed packages. In this release, for instance, second-generation packages can remove new types of components.

Those of us who have packaged our applications before 2GP was released have been unable to upgrade our package format, but with a little more patience (or by applying to the preview) we will soon be able to reap the benefits.

9. Time and Name Support in lightning-input-field

You know about Time fields, the ones that let you select a specific hour in 15-minute increments? 

Well if you’ve been using this data type, and had to create custom pages for it, you may have encountered the lack of support in the wonderful lightning-input-field component for LWC.

If you were building dynamic, configurable components, working around this would have been difficult (though not impossible). I’ve personally had to deal with this a few times this year, so I’m really glad that official support is inbound in the Winter ‘22 release!

In far less interesting news, the compound Name field (like the one for contacts) is now also supported. Yes, yes, very exciting I’m sure, but since it never personally affected me it is destined for exile at the bottom of this section.

Find out how other components have been updated here (or if Aura is more your style, here).

10. Enforced Release Updates

Several release updates are being automatically activated with this release, with the potential to break existing code. 

If you haven’t already done it, now is your last chance to use secure Visualforce Remoting calls, update your access permissions for Lightning components, and ensure your OAuth scopes are all correct!

Here is the list of updates being enforced. You can try them out in a preview sandbox to make sure your code works flawlessly!

Final Thoughts

The Salesforce Winter ‘22 release has a few solid gems in it, and some of the beta features are sure to improve things significantly in the future. Some of these updates will not appeal to everyone, while others will require the attention of every developer to ensure a smooth transition after the update is delivered.

I’m happy to see some big features finally greeting us, and Functions are sure to change the dynamics of some larger projects. The round of polishing Lightning components is also a very much welcome step. I’ll be looking forward to seeing how these changes progress through the coming year.

Add Comment