Winter'21 Release Notes
The Sandbox Preview window for Winter ‘21 begins on September 11, 2020. If you would like your sandbox to take part, it must be active on a preview instance before then.
1. Use the Safe Navigation Operator to Avoid Null Pointer Exceptions
Use the safe navigation operator (?.) to replace explicit, sequential checks for null references. This new operator short-circuits expressions that attempt to operate on a null value and returns null instead of throwing a NullPointerException.
Account a = null; System.debug(a?.Name); // null Account b = new Account(Name = 'Buster'); System.debug(b?.Name); // 'Buster'
2. Improve Apex Testing with New SObject Error Methods
Track errors with the new SObject.hasErrors() and SObject.getErrors() methods without performing a DML operation to check the result for errors. Dynamically add errors to specific fields with new SObject.addError() overload methods. Use the hasErrors() method to know if an SObject instance contains errors. Use the getErrors() method to retrieve the list of errors for a specific SObject instance.
Use the addError() overload methods in the System.SObject class to dynamically add errors to an SObject field- addError(String fieldName, String message[, Boolean doNotEscape])
- addError(Schema.SObjectField field, String message[, Boolean doNotEscape])
Know if an SObject instance contains errors
- Use the hasErrors() method in the System.SObject class.
Get the error details for an SObject instance
- Use the getErrors() method in the System.SObject class.
3. Send Custom Notifications from Apex
Use the Messaging.CustomNotification class to create, configure, and send custom notifications directly from Apex code, such as a trigger.
4. Detect Apex Runtime Context with RequestId and Quiddity
You can now detect Apex context at runtime and correlate multiple logs triggered by the request, using Request ID and Quiddity values. Use the methods in the System.Request class to obtain the Request ID and Quiddity of the current Salesforce request.
// Get info about the current request Request reqInfo = Request.getCurrent(); // Universally unique identifier for this request // Same as requestId in splunk or REQUEST_ID in event monitoring String currentRequestId = reqInfo.getRequestId(); // enum representing how Apex is running. e.g. BULK_API vs LIGHTNING // Use this with a switch statement, // instead of checking System.isFuture() || System.isQueueable() || ... Quiddity currentType = reqInfo.getQuiddity();
5. Scan a Barcode in a Lightning Web Component (Beta)
Use the BarcodeScanner API to add barcode scanning to your Lightning web components. Scan UPC, QR, and other standard barcode types from Lightning components running on a mobile device. Look up product details, record inventory scans, save contact details from a conference badge—your code, your way!
6. Trigger a Flow to Run Before a Record is Deleted
In Flow Builder, you can now configure a new record–triggered flow to run before a record is deleted. You no longer need to write Apex code to set this up. This autolaunched flow runs in the background and updates related records when a record is deleted.
7. Debug Flow Errors in Sandbox Org as Another User
Debugging a flow in a sandbox org is now easier than ever with the ability to debug a flow as another user. When you debug a flow as another user, you can catch flow exceptions such as unexpected permission, sharing, and profile configurations before they occur in production orgs.
8. Interactively Create Engaging Email Templates
Create email templates faster and more easily with visual tools in Email Template Builder. Instead of adding HTML code, your users can drag elements to create effective email templates. They can compose email templates with a few clicks to place design elements right where they want them.
9. Break Up Your Record Details with Dynamic Forms (Generally Available)
Dynamic Forms is the next step in the evolution of Lightning record pages. It adds the ability to configure record detail fields and sections inside the Lightning App Builder. This feature, which is now generally available and enabled for everyone, includes some changes since the beta release.
10. Analyze Your Lightning Page Performance
Discover ways to make your record page perform better based on analysis right inside the Lightning App Builder. Performance Analysis in App Builder evaluates the fields, instances of the Related Lists component, and metadata of a record page. With the click of a button, get best practices and suggestions for improving page performance and the end-user experience.
11. Find Changed Deals at a Glance
Opportunity deal change highlights help your sales team prioritize work by showing recent changes to amounts and close dates. For example, knowing which deals changed helps sales managers with their weekly coaching sessions. In the opportunities list view and Kanban view, text colors and arrows indicate amounts and close dates that changed during the last 7 days. And users can hover over an arrow to get details.
12. Auto Add Fields to Custom Report Types (Beta)
It’s time-consuming to add new custom fields to your reports, especially when you have many custom report types. Now with Auto Add, custom fields that you add to a Salesforce object are added automatically to all the custom report types based on that object. When you create a report from the custom report type, all the custom fields are right there for you to add to your report.
Beta feature
Close
Keep this in mind as action on
-
BEM Notation with Double Dashes Is Being Deprecated
The BEM notation with double dashes (--) in Lightning Design System will be deprecated in the next release (Spring ’21). For your SLDS styles to continue working, replace -- with _ in your CSS. For example, replace slds-button--brand with slds-button_brand. -
Aura Components in the ui Namespace Are Being Deprecated
Support for the deprecated components ends on May 1, 2021. Replace the deprecated components with their counterparts in the lightning namespace. These components are faster, more efficient, and they implement Lightning Design System styling out-of-the-box. You can continue to use these components beyond May 1, 2021, but Salesforce are not accepting support cases for them after that date. -
Enforcement for Profile-Based Access for@AuraEnabled Apex Classes
This update gives you more control over which users can access Apex classes containing @AuraEnabled methods. When this update is enforced, an authenticated user can access an @AuraEnabled Apex method only when the user’s profile allows access to the Apex class. This update is enforced in Winter ’21.
Changed Limits
- The client-side cache timeout has increased from 15 minutes to 8 hours, with a refresh interval of 15 minutes.
- Daily Per-User Limit for Automated Email Was Introduced. The new daily sending limit is 1,000 automated emails per user.
- Limit on Sales Cadence Active Targets Was Introduced. The limit of active targets in sales cadences is 150,000 per org. Previously, no limit applied.
Useful links:
Comments powered by CComment