Winter'23 Release Notes
The Sandbox Preview window for Winter ‘23 begins on August 11, 2022. If you would like your sandbox to take part, it must be active on a preview instance before then.
1. Write Clear and Intentional Apex Assertions
Improve the readability of your Apex code by using the assert methods in the new System.Assert class that fit the exact conditions that you’re checking for. Salesforce still support the existing System class assert methods. But Salesforce also recommend that you start using the new ones soon and that you update your existing code to use them.
For example, to assert whether two values are equal, use the Assert.areEqual() method, which is equivalent to the existing System.assertEquals():
String sub = 'abcde'.substring(2); Assert.areEqual('cde', sub);Here’s an example of checking for null values.
String myString = null; Assert.isNull(myString, 'String should be null');This example checks that exceptions are thrown from a method you’re testing and that they’re of the expected type.
try { methodUnderTest(); Assert.fail('Exception failure is always an option'); } catch (Exception ex) { Assert.isInstanceOfType(ex, DmlException.class); // Additional assertions }Use the new System.Assert class, which includes these methods.
- Assert.areEqual()
- Assert.areNotEqual()
- Assert.fail()
- Assert.isFalse()
- Assert.isInstanceOfType()
- Assert.isNotInstanceOfType()
- Assert.isNotNull()
- Assert.isNull()
- Assert.isTrue()
2. Enable Third-Party Integrations with Light DOM (Generally Available)
Lightning web components render in shadow DOM by default, providing strong encapsulation but posing challenges for global styling and many third-party integrations. With light DOM, your component markup is attached to the host element instead of its shadow tree. You can then access it like any other content in the document host.
Light DOM allows third-party tools to traverse the DOM, enabling standard browser query APIs like querySelector and querySelectorAll, without traversing the shadow root. It also facilitates global styling so you can apply custom branding to your components and child components easily.
To enable a component to render in light DOM, set the renderMode static field in your component class.
import { LightningElement } from 'lwc'; export default class LightDomApp extends LightningElement { static renderMode = 'light'; // the default is 'shadow' }Use the lwc:render-mode template directive on the <template> tag of your component.
<template lwc:render-mode='light'> <my-header> <p>Hello World</p> </my-header> </template>A light DOM component can contain a shadow DOM component. Similarly, a shadow DOM component can contain a light DOM component. However, base Lightning components always render in shadow DOM. Restricting light DOM to specific namespaces isn't supported. LWC doesn't scope styles automatically for you. To prevent styles from bleeding in or out of a component, use a *.scoped.css file to implement scoped styles for a component.
3. Create Overlays with the New Modal Component
Use modals to interrupt a user’s workflow and draw attention to an important message. A modal, which displays the message on top of the current app window, requires a user to interact with it to regain control over the app. To create a modal component, import LightningModal from lightning/modal in your JavaScript file. Then, create a component class that extends LightningModal.
/* c/myModal.js */ import { api } from 'lwc'; import LightningModal from 'lightning/modal'; export default class MyModal extends LightningModal { handleOkay() { this.close('okay'); } }This component doesn’t use a lightning-modal tag. Instead, the modal’s HTML template uses helper lightning-modal-* components to make the modal’s header, footer, and body. The lightning-modal-body component is required, and the others are optional.
<!-- c/myModal.html --> <template> <lightning-modal-header label="My Modal Heading"></lightning-modal-header> <lightning-modal-body>This is the modal’s contents.</lightning-modal-body> <lightning-modal-footer> <lightning-button label="OK" onclick={handleOkay}></lightning-button> </lightning-modal-footer> </template>
4. Synchronize Component Data Without a Page Refresh by Using RefreshView API (Pilot)
Whether user-driven or app-invoked, the ability to synchronize data without reloading an entire page is a key user experience requirement. The new lightning/refresh module and RefreshView API provide a standard way to refresh component data in LWC and Aura. Previously, LWC lacked a data refresh API, and Aura only supported the legacy force:refreshView, which doesn’t meet the requirements of modern web development. RefreshView API’s detailed control of refresh scope lets developers create refined user experiences while maintaining backward compatibility.
RefreshView API updates the data for a specific hierarchy of components, known as a view, without reloading an entire page. This refresh ensures complete synchronization with data externally sourced by components in that view. RefreshView API can refresh data for Salesforce platform containers and custom components.
Pilot feature
Close
5. Build Components in Mixed Shadow Mode (Beta)
With mixed shadow mode, Lightning web components can use native shadow DOM even when the synthetic shadow polyfill is applied. Mixed shadow mode is disabled by default. Contact Salesforce Customer Support to enable mixed shadow mode.
To enable mixed shadow mode on a component, set the static shadowSupportMode property to any.
// native.js import { LightningElement } from 'lwc'; export default class NativeComponent extends LightningElement { static shadowSupportMode = 'any'; }Valid values for shadowSupportMode include:
- any — Renders the whole component subtree in native shadow DOM where possible. If the browser doesn't support shadow DOM, the subtree renders in synthetic shadow.
- reset — Enables a subclass to opt out of receiving the shadowSupportMode value from its superclass. reset applies only if the component’s superclass is using any and no parent components are using any.
Lightning Experience and Experience Cloud include the synthetic shadow polyfill by default. When the polyfill is present, reset defaults to synthetic shadow. If the polyfill isn't present, such as in Lightning Out or LWC Open Source, shadowSupportMode has no impact and components render in native mode.
By default, slotted content is rendered in native shadow. Slotted content isn’t descended from the component it’s nested in, so you can slot synthetic shadow content into a native shadow component. This also means that slotted content isn’t affected by how your browser renders the #shadow-root of the component containing the slot. For example, if your browser renders a native component in synthetic shadow, native content slotted into that component is still rendered in native shadow.
Beta feature
Close
6. Secure Even More Apex Code with User Mode Database Operations (Beta)
Run more database operations in user mode with the enhanced user-mode support. The new Database methods support an accessLevel parameter so that you can run the operations in user mode instead of in the default system mode.
Salesforce introduced the user mode feature in the Summer '22 release with an initial set of overloaded System.Database methods that perform DML and query operations. Salesforce added these new methods in this release.
- Database.getQueryLocator methods
- Database DML methods (deleteAsync, deleteImmeidate, insertAsync, insertImmediate, updateAsync, and updateImmediate)
Beta feature
Close
Salesforce doesn’t guarantee general availability of this feature within any particular time frame or at all, and salesforce can discontinue it at any time. It’s offered as is and isn’t supported, and Salesforce has no liability for any harm or damage arising out of or in connection with it. You can provide feedback and suggestions for the feature in the Trailblazer Community.
7. Develop Event-Driven Apps with Pub/Sub API (Generally Available)
Publish and subscribe to platform events and change data capture events using Pub/Sub API, a secure, highly performant, and scalable API based on gRPC. Use one of the 11 supported programming languages, including Python, Java, Go, and Node. Get peace of mind with final publishing results instead of intermediate queueing results. And with subscription flow control, fine-tune the number of event messages that you receive based on your event processing speed.

Pub/Sub API uses protocol buffers as the Interface Definition Language (IDL) and as the underlying message interchange format. The Pub/Sub API service is defined in a proto file, with RPC method parameters and return types specified as protocol buffer messages. Within those protocol buffer messages, the payload of the published and delivered events is encoded in binary Apache Avro.
This proto file example is based on the Pub/Sub API proto file, but salesforce shortened it in this illustration. This proto file defines the service by listing the methods to publish, subscribe, get the schema, and get the topic information.

8. Filter Your Stream of Platform Events with Custom Channels (Generally Available)
Optimize event processing by receiving only the event messages that match a predefined filter on a custom channel. Create a channel and configure it with a filter expression for CometD clients. With fewer events delivered, subscribers can make more efficient use of the event delivery allocation.
(City__c LIKE 'S%' OR City__c = 'New York') AND Delivery_Date__c > 2022-07-21T09:30:11-08:00 AND Has_Shipped__c = TRUEWith this feature you can unload your system, please review this article to be familiar with platform event allocation.
To monitor your standard-volume event delivery usage, use the limits REST API resource, and inspect the DailyStandardVolumePlatformEvents value. And to monitor the publishing usage, inspect the HourlyPublishedStandardVolumePlatformEvents value.
- This feature is supported for high-volume custom platform events that you define. It isn’t supported for legacy standard-volume custom platform events or standard platform events such as real-time event monitoring events.
- This feature supports CometD subscribers. It doesn’t support other types of subscribers such as Apex triggers, flows, and processes.
9. Chart Your Apex Course with the Save Order of Execution Diagram
As you requested, here's a diagram to represent the save order of execution, which is the order that events are applied when you save a record in Salesforce. The diagram is available on the Salesforce Architects site and linked from Triggers and Order of Execution in the Apex Developer Guide.
10. Create Custom Address Fields (Generally Available)
To improve address data accuracy and your users’ experience, create custom fields that mimic the behavior of standard address fields.
11. Select Multiple Records in the Lookup Flow Screen Component
Now you can search and then select more than one record with the Lookup flow screen component. You can specify a selection maximum and one or more default records. Just add the Lookup component to your screen flow and set the Maximum Selections field to a value greater than 1.
Keep this in mind as action on
-
Enable Enhanced Domains (Release Update)
Enhanced domains are the latest version of My Domain that meets the latest browser requirements. With enhanced domains, all URLs across your org contain your company-specific My Domain name, including URLs for your Experience Cloud sites, Salesforce Sites, Visualforce pages, and content files. This feature changes domain suffixes (the part after the My Domain name) to meet the latest security standards. With no instance names, enhanced My Domain URLs are easier for users to remember and don’t change when your org is moved to another Salesforce instance. Because enhanced domains meet the latest browser requirements, they’re enabled by default in new orgs and required in all orgs in Spring ’23.
Potential Impact
If enhanced domains aren’t deployed in your Salesforce org before the Spring ’23 release, Salesforce enables them for you. If you don’t test and enable enhanced domains before the enforcement date, here are some issues that can arise.
- Users can experience errors when attempting to access Salesforce, including but not limited to Experience Cloud sites, Salesforce Sites, and Visualforce pages.
- Some embedded content stored in Salesforce no longer appears.
- Third-party applications can lose access to your data.
- Single sign-on integrations with sandboxes can fail.
- Single sign-on integrations with orgs using the *.cloudforce.com and *.database.com domain suffixes can fail.
-
Be Ready for Multi-Factor Authentication Auto-Enablement
The requirement to use multi-factor authentication (MFA) when accessing Salesforce products went into effect on February 1, 2022. All users must now use MFA when they log in to Salesforce, whether they’re logging in directly or using single sign-on (SSO). To help customers satisfy this requirement, in the first half of 2023, Salesforce is automatically enabling MFA for direct logins. In fall 2023, Salesforce are enforcing MFA by making it a permanent part of the Salesforce login process. To avoid disruptions to your users when these milestones occur, enable MFA as soon as possible. -
Legacy API Versions 21.0 Through 30.0 Are Being Retired (Release Update)
Versions 21.0 through 30.0 of the Salesforce Platform API are being retired in Summer ’23. They are now deprecated and are no longer supported by Salesforce. The Release Card was first available in Summer ’21 and this change was first announced in October 2020. You can continue to use these legacy API versions until Summer ’23 is released. At that time, these legacy versions will be retired and unavailable. When these legacy versions are retired, applications consuming these versions of the APIs will experience disruption. The requests will fail with an error message indicating that the requested endpoint has been deactivated. -
Fix Invalid HTML Syntax to Avoid Component Loading Errors
Invalid HTML syntax in your LWC markup now results in a runtime error. Previously, components loaded without returning a warning even if they included invalid HTML syntax.
The framework enforces valid syntax in all Lightning web components. In Spring ’22, the web console displays invalid HTML syntax warnings to promote standard HTML practices in your code. In Winter ’23, these warnings are converted to errors and can prevent your components from loading correctly. Invalid HTML syntax includes:- Missing or misplaced DOCTYPE tag
- Missing or misplaced head start tag
- Nested noscript in head element
- Non-matching opening and closing tags
- Unexpected end of file
- Unexpected metadata element after head element
-
Fix Invalid Template Usage to Avoid Warning When Component Loading
Loading an LWC component results in a warning if your component includes a <template> element with an invalid attribute. On non-root <template> elements, only for:each, iterator:iteratorName and if:true|false directives are supported. -
Remove Non-Global Design Tokens in CSS
Only design tokens labeled as Global Access (GA) are supported in your Lightning web components' CSS. Non-global design tokens no longer work after Spring '23. Ensure that your Lightning web components are using design tokens with global support only.
Changed Limits
-
Limits on Concurrently Open Query Cursors are Removed
Query cursors open concurrently per user are no longer restricted in number. Batch Apex start, execute, and finish method result sets are also included. -
Create Longer Forecast Adjustment Notes
When you adjust your forecasts, you can enter up to 255 characters in adjustment notes. This change provides more space to capture details such as who adjusted the forecast and why. Previously, you could enter up to 140 characters in a forecast adjustment note. -
Enjoy Longer Access to More Query Results
Some limitations on query results have been removed. Pagination beyond 10 result sets per user is now supported, and query results are available for 2 days, including results in nested queries. This change removes some limitations on query results that were too large or contained complex records. Previously, a maximum of 10 result sets per user were accessible at the same time, and the oldest set expired after 15 minutes of inactivity. -
Implement More Feature Parameters
The default limit on feature parameters has increased from 25 to 200. Use feature parameters to activate pilot features, track activation metrics, or make features available for a limited time. This change applies to new and existing first- and second-generation managed packages. If you’re new to using feature parameters, start by installing the Feature Management App in to your License Management Org. -
Salesforce CMS Workspaces Limited to 2,000
To improve Salesforce CMS performance, each instance is limited to 2,000 workspaces. This limit includes CMS workspaces and enhanced CMS workspaces. -
Salesforce CMS Channels Limited to 300
To improve Salesforce CMS performance, each instance is limited to 300 channels. This limit doesn’t include Experience Cloud sites connected to CMS workspaces. -
Email-to-Case enforces the Apex 10 minute processing limit
If your Apex custom code can’t complete processing an email after 10 minutes, Email-to-Case halts the process. On request, Salesforce Customer Support can adjust this limit.
Useful links:
Comments powered by CComment