Salesforce Winter ’25 release notes are out to showcase all-new enhancements planned for the Salesforce Winter ’25 release. This post will provide the top 10 features for Salesforce developers in the Winter ’25 release.
1. Create LWCs with TypeScript (Developer Preview)
TypeScript is an open-source language to build large-scale web apps. Now we can use this language to create Lightning Web Component. Right now we can make Lightning Web Component using javascript only but now developer who already worked with typescript can use their favourite language. They can even change their existing Javascript LWC to typescript LWC.
TypeScript is a superset of JavaScript that boosts developer productivity and code quality. It supports build-time type checking, which helps detect errors and improves code reliability. We can enhance code discoverability and quality through type-based auto-completion and static type analysis in development tools such as Visual Studio Code.
Below image shows, how typescript can provide error and syntax highlighting in VS Code.
Refer to Salesforce Developer Posts
- How to Use TypeScript with Salesforce – Part 1
- How to Use TypeScript with Salesforce – Part 2
- Develop Lightning Web Components with TypeScript (Developer Preview)
2. Real-Time Preview for Lightning Web Components (Beta)
We can build Lightning Web components locally with the Local Dev (beta) feature. It allows us to preview Lightning web components that were developed for the Lightning app or Experience Cloud Lightning Web Runtime site.
When Local Dev detects source code changes, the preview automatically updates in the browser, allowing us to iterate on our LWCs faster without deploying code or manually refreshing the page.
The below screenshot shows the previewed component on the Local Development Server’s desktop browser.
Below image shows the previewed component on a virtual mobile device.
Refer to LWC Local Development Server (Beta) for more details about Local Dev development.
3. Improved SOQL Errors
SOQL execution will now throw improved errors for invalid queries. This is important to change existing apex code especially dynamic code which handles logic based on error message or code.
3.1 Invalid SOQL Error
We will get better SOQL errors while executing invalid queries. It will specify which part of SOQL is throwing an error so that developer can easily change an invalid token or tag.
//unexpected token
Query 1 : SELECT Id,Name FROM Account USING everything
Old Error : unexpected token: '<EOF>'
New Error : unexpected token: 'everything'
3.2 Negative Value in Filter Condition
We can now use negative values in the filter condition for SOQL. This was not possible till API version 62.
// This will return account where account balance is l<500 USD.
SELECT Name FROM Account WHERE AccountBalance < USD-500
3.3 Error for SOQL with NULL literals in WHERE statements
Right now we are getting invalid operator
when we use NULL literals in WHERE statements with the LIKE keyword. This will now throw an unexpected token: ‘NULL’ error.
system.debug([SELECT Id, Name FROM Account WHERE PersonEmail LIKE NULL AND Name LIKE '%a%'
]);
Current Error - Line: 327, Column: 14
SELECT Id, Name FROM Account WHERE PersonEmail LIKE NULL AND Name LIKE ^ ERROR at Row:1:Column:36 invalid operator
New Error - Current Error - Line: 327, Column: 14
SELECT Id, Name FROM Account WHERE PersonEmail LIKE NULL AND Name LIKE ^ ERROR at Row:1:Column:36 unexpected token: 'NULL'
3.4 Proper error for SOQL queries with invalid datetime literals
We will get the proper error like ‘Invalid datetime’ for invalid datetime literals in SOQL where clause.
SELECT Id FROM Account WHERE SystemModstamp >2020-12-12t12:12:00-25:00
Old: line 1:67 mismatched character '5' expecting set '0'..'3'
New: Invalid datetime: 2020-12-12t12:12:00-25:00
3.5 Error for Invalid Bind Variable
unexpected token error is thrown when the bind variable is not used in SOQL.
SELECT Id FROM Account WHERE CreatedBy=: 0050W000007Jz7jQAC
Old: Only variable references are allowed in dynamic SOQL/SOSL
New: unexpected token: '0050'
4. Get Help Creating Flow Formulas with Einstein (Beta)
Einstein generative AI can help you get the correct functions and operators for your requirements. Einstein’s formulas are only available in the Flow Formula Builder. As generative AI can produce incorrect or harmful responses, we should test the formula in the builder for accuracy and safety before activating flow.
How to enable Einstein AI?
Enable Einstein generative AI in Setup. Then, in Setup, find and select Process Automation Settings, and enable formulas created by Einstein.
Steps for Formula Builder
- To create formulas with Einstein, open a Formula resource or an element with Formula Builder. Open the Einstein section and click the Einstein button (1).
- Describe the formula you want Einstein to create (2).
- When adding resources to your formula description, use the resource menu (3) to select them instead of manually writing them in.
- Click Create (4).
- After Einstein creates the formula (5), check its syntax to make sure it’s set up correctly (6) and test your formula for accuracy and safety before activating the flow.
5. Restrict User Access to Run Flows (Release Update)
With the Salesforce Winter ’25 release update, Salesforce restricts a user’s ability to run a flow. Now flow can be executed only by users who are granted correct profiles or permission sets.
This update was first made available in the Winter ’24 and was supposed to be enforced in the Winter ’25, but the enforcement date is moved to Winter ’26.
6. Access the Parent Element on a Component
The developer now can access the parent element in child lightning web components using this.hostElement in a renderedCallback or in another callback.
7. Manage Styles with Class Object Binding
We can provide multiple classes on an element with a JavaScript array or object in LWC API version 62.0 and later. Now it is not required to concatenate strings to pass in multiple classes. Below LWC will demonstrate this feature.
When we use computedClassNames in HTML elements like
<button onclick={doSomething} class={computedClassNames}>Submit</button>
it will be rendered like
<button class="button__icon button_left button_full-width">Submit</button>
in LWC API 62 and above<button class="button__icon,,button_left,[object Object]">Submit</button>
below LWC API 62
8. Access the Component’s Style Information
The developer can use this.style object to access component style. They can retrieve or set component style using this object.
9. Scale Process Platform Events with Parallel Subscriptions (Generally Available)
Salesforce Platform Events enable us to send secure, scalable, and customizable event notifications both within Salesforce and from external systems. Apex triggers allow us to subscribe to platform events and process them as they arrive. Few businesses create large volumes of events. To handle those large volumes of events Salesforce allows Parallel subscriptions. Parallel subscriptions allow processing events concurrently rather than in a single stream.
How Parallel Subscriptions Work?
When we enable parallel subscriptions for a platform event Apex trigger, multiple subscriptions are generated internally for the trigger. When events from the event bus match the platform event to which the trigger is subscribed, they are distributed across the internal subscriptions. The internal subscriptions, also known as partitions, run and process events simultaneously. A trigger can be configured with up to ten partitions.
Each internal subscription processes a unique set of events. The partition key you specify determines which events each subscription processes, whether a platform-event custom field is marked as required or the standard EventUuid field. The system employs a hash function to convert the value in the partition key field into a hash value that determines which subscription handles an event.
Checkout Platform Event Processing at Scale with Parallel Subscriptions for Apex Triggers for more detail to setup parallel processing.
10. Write Mock SOQL Tests for External Objects
Developers can now create better Apex unit tests for external objects to increase code coverage and quality. They can mock SOQL query responses by using the new SOQL stub methods and a new test class.
Create mock test classes by extending the new System.SoqlStubProvider class and overriding the handleSoqlQuery() method. Create external object records with either Test.CreateStubQueryRow() or Test.createStubQueryRows(). Register the mock provider in the test with Test. createSoqlStub() and run the test code.
Checkout example at Mock SOQL Tests for External Objects
References
Salesforce Winter ’25 Release Notes
Other Posts
- Ultimate Guide to URL Accessibility in LWC
- Top 5 Salesforce Apex Features of Summer’24
- Implementing Apex Cursors for Optimal Resource Management in Salesforce
- How to Dynamically Evaluate Formulas in Salesforce Apex?