Salesforce spring'21 Release - Dev Features
Tags: salesforce, crm, salescloud, servicecloud
Published: 2021-01-12 12:54:06

Salesforce's new release is fast approaching, some of you have already had a chance to experience the new features.

Let's take a few minutes to take a look at the good part of the release. 

##📌 Being able to select all fields using SOQL 
In previous versions of SOQL, retrieving fields meant specifying all the names of all the fields you wanted to retrieve.

Well, Not Anymore 🎉🎉

📣 Now you are able to include pre-defined groupings of fields within a query statement using the new FIELDS() function.

```sql
SELECT FIELDS(ALL) FROM Account LIMIT 200
SELECT FIELDS(CUSTOM) FROM Account LIMIT 200
SELECT FIELDS(STANDARD) FROM Account
```
You can also mix FIELDS() with other field names in the field list. For example:
```sql
SELECT Name, Id, FIELDS(CUSTOM) FROM Account LIMIT 200
SELECT someCustomField__c, FIELDS(STANDARD) FROM Account
```

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/p8aee6rsjq75b2tqxnq5.png)

However, if you already know which fields you want to retrieve, you will get better performance by specifying them explicitly rather than using `FIELDS()` and retrieving more fields than you need.

As some of you know already, SOQL automatically pages the results if a SELECT statement returns a large amount of data that is expensive to retrieve. This can occur, for example, if the object contains many fields or contains `CLOB` or `BLOB` fields. It can also occur if FIELDS() returns a large amount of data.

And the last thing that you should know about this feature is that you should limit the result rows to be less than or equal to 200 records.

##📌 Access Custom Metadata Type Records Using Static Methods
Use the Apex `getAll()`, `getInstance(recordId)`, `getInstance(qualifiedApiName)`, and `getInstance(developerName)` methods to retrieve information from custom metadata type records faster.

```java
List<Games__mdt> mcs = Games__mdt.getall().values();
boolean textField = null;
if (mcs[0].GameType__c == 'PC') {
   textField = true;
}
system.assertEquals(textField, true);
```

##📌 Flag Invocable Apex Methods That Make Callouts

I always used a future method to make a callout inside an invocable method, today I am so excited to share with you this feature.

```java
@InvocableMethod(callout=true, label="My Action Label")
```
##📌 Customize Markers and Control Map Behavior

You customize your map the way you want and make it look as designed, by defining the markers and controlling the behavior in the lightning-map Base Component.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/nlr0qrqanyikzi6rvuge.png)

```html
<template>
   <lightning-map
       map-markers={mapMarkers}
       options={mapOptions}
   ></lightning-map>
</template>
```

In mapOptions, set the disableDefaultUI property, which disables zooming and removes the Map or Satellite buttons. To disable panning the map, set the draggable property.

```js
import { LightningElement } from 'lwc';
export default class LightningExampleMapCustomMarker extends LightningElement {
   mapOptions = {
                   'disableDefaultUI': true // when true disables Map|Satellite, +|- zoom buttons
                   'draggable': false, // when false prevents panning by dragging on the map
   };
   mapMarkers = [
      {
         location: {
                      City: 'San Francisco',
                      Country: 'USA',
                      PostalCode: '94105',
                      State: 'CA',
                      Street: '425 Mission St',
                   },
          mapIcon : {
                      path: 'M 125,5 155,90 245,90 175,145 200,230 125,180 50,230 75,145 5,90 95,90 z',
                      fillColor: '#CF3476',
                      fillOpacity: .5,
                      strokeWeight: 1,
                      scale: .10,
                    }
      }
   ];
}
```

##📌 Aura Components in the ui Namespace Are Being Deprecated

📣 Salesforce will not support the ui Namespace starting from May 1, 2021. Be sure you plan a migration as soon as possible.

**some examples:**

Instead of
```html
ui:actionMenuItem
```
Use
```html
 lightning:menuItem 
```

##📌 Create a Lightning Web Component Action (Pilot)
Creating quick action required us to use the Aura component for it, today Salesforce made it possible by using LWC, however, be aware that this is still a Pilot and you can not use it in production yet. 

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/mmeb8f5gewe42fy8mv6b.png)

##🚨🚨🚨 Advance Notice of Upcoming Retirement of Platform API Legacy Versions 🚨🚨🚨

With the Summer ’21 release, legacy versions of the Salesforce Platform API will be retired and will no longer be supported by Salesforce

**SOAP API**
7.0, 8.0, 9.0, 10.0, 11.0, 11.1, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0

**REST API**
20.0

**Bulk API**
16.0, 17.0, 18.0, 19.0, 20.0

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/slyuo349k7apkdf72gsx.png)

## Learn more

I highlighted the features in this blog that i think will have a big impact on the way we are developing today, if you want to see more features, please follow this [link](https://help.salesforce.com/articleView?id=release-notes.salesforce_release_notes.htm&type=5&release=230)

I hope this helps, You can find me on Twitter [@abdel_force](https://twitter.com/abdel_force).