Skip links

6 Non-obvious Salesforce Spring Release ‘23 Features Every Developer Needs

Surely you have read plenty of articles with the Spring Release ’23 summary review. In this article we want to share with you cool Spring Release ’23 features that may be less obvious (yet helpful in daily developer work!):

1. ApexTypeImplementor

Area: Apex

ApexTypeImplementor is now generally available! The feature is designed to help you understand which Apex classes directly or indirectly implement an interface. With a SOQL query, you will be able to get info about public or global Apex implementors.

Check out this comprehensive example:  

// Common interface that all rounding strategies will implement
public interface RoundingStratergy {
    Decimal round(Decimal toRound);
}

public abstract class RoundingStrategies {
    public class Ceiling implements RoundingStratergy {
        public Decimal round(Decimal toRound) {
            return toRound.round(System.RoundingMode.CEILING);
        }
    }
    
    public class HalfDown implements RoundingStratergy {
        public Decimal round(Decimal toRound) {
            return toRound.round(System.RoundingMode.HALF_DOWN);
        }
    }
    
    public class TwoDecimalPlaces implements RoundingStratergy {
        public Decimal round(Decimal toRound) {
            return toRound.setScale(2, System.RoundingMode.HALF_UP);
        }
    }
}

List<ApexTypeImplementor> interfaceImpls = [
            SELECT ClassName, ClassNamespacePrefix
            FROM ApexTypeImplementor 
            WHERE InterfaceName = 'RoundingStratergy' and IsConcrete=true];
        
// For example, an Admin could be presented with a list of Apex classes 
// that could be applied. Simulated selection of 2 decimal places
ApexTypeImplementor selectedRoundingStratergy = interfaceImpls[2];
System.assertEquals('RoundingStrategies.TwoDecimalPlaces',
    selectedRoundingStratergy.ClassName);
        
// Create an instance of the class that implements the interface
RoundingStratergy rs = (RoundingStratergy)   Type.forName(selectedRoundingStratergy.ClassNamespacePrefix,
    selectedRoundingStratergy.ClassName).newInstance();
        
Decimal rounded = rs.round(7.1459);
System.assertEquals(7.15, rounded);

2. DataWeave in Apex in the Beta Stage

Area: Apex

This long-anticipated feature uses MuleSoft’s DataWeave library to extract data from one format, transform it, and output it in a required format. You can create DataWeave scripts as metadata and invoke them directly from Apex. Practically, it means that you can parse and transform CSV data, serialize Apex objects with custom data formats, and many more. The feature was introduced during Winter ’23 Release and entered the Beta in the Spring release.

3. System.enqueueJob Method

Area: Apex

New optional override adds queueable jobs to the asynchronous execution queue with a specified delay of up to 10 minutes. Using the System.enqueue(queueable, delay) method ignores any org-wide enqueue delay setting. The delay is ignored during Apex testing.

Example:

Integer delayInMinutes = 5;
ID jobID = System.enqueueJob(new MyQueueableClass(), delayInMinutes);

4. LWC Render Time Improvement

Area: Lightning Web Components 

Salesforce has optimized the framework of static elements handling to decrease the render time for your Lightning web components. The update influences how style and class attributes of your static nodes are rendered in the DOM.

 Example: that is how the attribute ENWAY Journal rendered before:

<div class="ENWAY Journal">

Now that attribute can render with an extra space:

<div class=" ENWAY Journal">

 Note that Salesforce recommends updating the code and revising the query to use a selector that disregards whitespace changes:

document.querySelector('.ENWAY journal')

5. Reverse Function

Area: Customization

With a new Reverse Function, you will be able to return the characters of a source text string in reverse order while building formulas. The reverse function is available in the list of all functions. 

Salesforce Spring Release ’23


6. Easier Connection of Salesforce With MuleSoft 

Area: Customization

No more complex configurations via multiple pages – a few clicks are all you need to connect Salesforce with Mulesoft. Log in to the MuleSoft AnyPoint Platform and import MuleSoft Services to Salesforce via one page.

How to use:  From Setup, in the Quick Find box, enter MuleSoft. Then select MuleSoft > Services. Click Log In and follow the instructions.

Salesforce-Mulesoft connection

This is a brief overview of helpful features. To learn more about the Salesforce Spring Release ’23, check out official release notes.