

Sudipta Deb
Founder of Technical Potpourri, Co-Founder of Shrey Tech, Enterprise Cloud Architect
Salesforce Winter '25 Release is here. I have published few dedicated posts and videos covering new features from Winter'25 release. If you haven't checked them out, please go ahead and check them below.
- New Admin Features from Winter '25
- New Flow Features from Winter '25
In today's blog post, I will share all the new Apex features that are coming along with the Winter 25 release. Please provide your feedback in the comment, and don't forget to subscribe to my youtube channel and blog pot.
Watch The Video Or Read The Article (Or Do Both
)
The form you have selected does not exist.

Understand SOQL Error and Functionality Changes to Update Your Code
The biggest change that is coming is the support of negative currency value is dynamic SOQL queries. This is only applicable if the multi-currency is enabled in your org. For example, below query will fetch all oprtunities where amount is less than -CAD - 1000.

Not only that, the error messages become more self-explanatory.
SELECT Id FROM Account USING everythingOld:
unexpected token: '<EOF>'New:
unexpected token: 'everything'SELECT ParentId, Value FROM InteractionRefOrValue WHERE ParentId IN ()Old:
unexpected token: ')'New:
unexpected token: 'ParentId IN ()'SELECT FROM ServicePresenceStatusOld:
unexpected token: 'FROM'New:
unexpected token: 'SELECT FROM'
Improved Consistency When Iterating Sets
Starting version 62, modifying elements of a set while iterating the set in a for or foreach() loop throws an exception. For example, below code will not provide you any error when the API version is below 62, but you might get some unexpected result. Starting version 62, this code snippet will give you System.FinalException exception stating that you cannot modify a collection while it is being iterated.

Write Mock SOQL Tests for External Objects
When we write any Apex class which involves some sort DML operation around the External object, we need to write the test classes as well. Writing test class is needed to make sure atleast 75% of the code is covered in the test class with both positive, negative and bulkified scenarios. In case of SOQL statements, we normally create the test data in the test setup method and query them in the test methods. But in case of SOQL which involves External object, we can not do that and also we can not directly query the External objects. But test coverage is needed for the Apex class to be deployed in Production.
In Winter 25 Release, Salesforce brings the solution to this problem. Now we can write mock SOQL statements for External Objects.
I have published a dedicated blog post and youtube video covering this topic. You can find it below
Track Apex Unexpected Exceptions with Free-Tier Event Monitoring
You can now take advantage of free-tier access to Event Monitoring, and track unhandled exceptions in Apex code execution instead of relying only on unhandled exception emails. You can now troubleshoot your Apex code by analyzing the information captured in the event log files for the Apex Unexpected Exception event type

Final Thoughts
That's all for today. I hope with this blog post and youtube video, you will be able to figure out all the cool apex enhancements that are coming with Winter 25 release. In next couple of days, I will bring more Winter 25 features in this blog as well as my youtube channel. So it is highly recommended that you please subscribe to my channel and blog to come to know about all the nice features. Thank you!!
Disclaimer
This article is not endorsed by Salesforce, Google, or any other company in any way. I shared my knowledge on this topic in this blog post. Please always refer to Official Documentation for the latest information.



0 Comments