DEV Community πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’»

DEV Community πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’» is a community of 966,904 amazing developers

We're a place where coders share, stay up-to-date and grow their careers.

Create account Log in
Cover image for Salesforce spring'21 Release - Dev Features
Abdelhakim Mouttaqui
Abdelhakim Mouttaqui

Posted on

Salesforce spring'21 Release - Dev Features

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.

SELECT FIELDS(ALL) FROM Account LIMIT 200
SELECT FIELDS(CUSTOM) FROM Account LIMIT 200
SELECT FIELDS(STANDARD) FROM Account
Enter fullscreen mode Exit fullscreen mode

You can also mix FIELDS() with other field names in the field list. For example:

SELECT Name, Id, FIELDS(CUSTOM) FROM Account LIMIT 200
SELECT someCustomField__c, FIELDS(STANDARD) FROM Account
Enter fullscreen mode Exit fullscreen mode

Alt Text

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.

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

πŸ“Œ 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.

@InvocableMethod(callout=true, label="My Action Label")
Enter fullscreen mode Exit fullscreen mode

πŸ“Œ 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

<template>
   <lightning-map
       map-markers={mapMarkers}
       options={mapOptions}
   ></lightning-map>
</template>
Enter fullscreen mode Exit fullscreen mode

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.

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,
                    }
      }
   ];
}
Enter fullscreen mode Exit fullscreen mode

πŸ“Œ 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

ui:actionMenuItem
Enter fullscreen mode Exit fullscreen mode

Use

 lightning:menuItem 
Enter fullscreen mode Exit fullscreen mode

πŸ“Œ 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

🚨🚨🚨 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

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

I hope this helps, You can find me on Twitter @abdel_force.

Latest comments (1)

🌚 Friends don't let friends browse without dark mode.

Sorry, it's true.