Salesforce ’20 Release: LMS, Dynamic Forms, User Permissions and more

Salesforce is generous with releasing new features, pleasing the community with three seasonal releases each year: Spring, Summer, and Winter.

 

The Salesforce Summer 2020 release sprouted a lot of reviews and questions. But we wanted to give you more practical feedback about the newly introduced features, the experience we had on projects before they were introduced, what they could be useful for, and any limitations we see about these features. After all, Noltic is a 100% Salesforce solution vendor, so we know a thing or two about the platform.

 

Ready? Let’s go!

Introducing Dynamic Forms

This is probably the best feature Salesforce introduced in the Summer ‘20 release, and that’s why it’s number one on our list. This was actually requested a few times by our customers, so yay.

Previously, to accomplish this, we had to build custom components and use fieldsets to allow customers to dynamically select fields that would appear on different parts of the page, as opposed to a monolithic block of fields in one place.

 

Another cool thing is that you can now leverage visibility rules to show and/or hide sections and fields. With this step, Salesforce has really outdone itself in terms of bringing flexible no-code solutions to its clients.

 

Unfortunately, we can’t use custom dynamic forms in development, so the feature is useful for administrators only.

Lightning Message Service Integration

Lightning Message Service (LMS) is a library that improves communication between UI components. The main problem LMS solves is various approaches to publishing and receiving messages across the Visualforce, Aura, and LWC components.

The components of the library include:

  • Message Channel. The main component that enables messaging via LMS. To address it, code @salesforce/messageChannel in LWC, $MessageChannel global variable in Visualforce components, and lightning:messageChannel in Aura components.
  • Scope. Defines the context for publishing, i.e., which subscriber components will receive messages. There are two scopes: active (default) and application. The active scope includes subscribers only from the active area of the application. The application or global scope ensures that all subscribers get the message, even if that application area is inactive.
  • Publish. A method to send messages through a message channel.
  • Subscribe. A method to receive messages from a message channel.

 

LMS makes communication across different components flexible and straightforward. Plus, it’s easier to develop and maintain connected components.

CSS Style Sharing within Lightning Web Components

With this release, you can also share CSS styles within Lightning Web Components.


Now, it’s easier than ever to share code as well as styles and extend the styles of basic components in just a few clicks. This feature will come especially in handy when working with sets of extendable components.

 

You can also achieve a similar result using SCSS in LWC. It features a slightly different syntax, though, since you need to reference the file instead of the component itself.

Status Inquiry for Asynchronous Platform Event Publish Operations (Pilot Feature)

Now you can track the status of the logic executed under platform events using the publish status events. This feature is especially useful when you need to get the results after publishing events, regardless of their occurrence.

 

Imagine you need to run some synchronization with platform events and send some payload inside. Sometimes, the sync may fail due to various reasons, like the lack of the necessary data, bad data updating conditions, etc. Currently, we can only identify whether events were published or not, but receive no information about the logic execution inside platform event triggers, so publishers can’t determine if it was successful or not.

To make sending the execution status possible, you can create a separate platform event and error handling logic. This new feature will make everything available out of the box, eliminating the need for custom status notification mechanisms. This will also reduce the amount of work necessary for building these notifying mechanisms.

 

Unfortunately, it’s a pilot feature, so you can’t request it now. So it’s hard to tell how it will respond to different error types, retries, etc.

Removing Lightning Components from Managed Packages

As the Salesforce platform improves, some components get removed, deprecated, or replaced with newer and better ones. Up until now, there was no way to delete LWC & Lightning components from a managed package. With this new feature, Salesforce ISV partners can improve their products by removing the components that are no longer necessary.

SFDX (Second-Generation Packages)

It looks like Salesforce is betting on second-generation packages, with quite a few features released to help with their development as well as converting first-generation packages to second-generation. These are the features we’re talking about:  

Aura Components in the ui Namespace to Be Deprecated

Starting from May 1, 2021, Salesforce will stop supporting Aura components in the ui namespace. So, if you’re still using them, consider looking at the component in the lightning namespace or writing custom ones.

User Permissions for Lightning Web Components

Salesforce has a flexible permission system. There are two types of permissions: system and custom permissions, which are stored in Profile and Permission Sets. Checking those permissions has become truly effortless. Look at this code sample. It’s as easy as importing a static reference.
import hasPermission from '@salesforce/userPermission/PermissionName'; 
Now, imagine you want to know if a user has permission to see an expense report. The following code snippets are succinct and sufficient.
//ExpenseReport.js

import { LightningElement } from 'lwc';

import hasViewReport from '@salesforce/customPermission/acme__ViewReport';

export default class App extends LightingElement {

    get isReportVisible() {

        return hasViewReport;

    }

}

//ExpenseReport.html

<template if:true={isReportVisible}> 
It might be hard to keep track of all the innovations SFDC is rolling out, so keep that ear to the ground! We hope the comments Noltic’s experts gave on the eight updates of the summer ‘20 release were as useful for you as they were exciting for us. And if you liked them, check out other articles in Noltic’s blog. Stay tuned!

Did you enjoy this post?

Please, share it on your social media:

Share on facebook
Share on twitter
Share on linkedin

Looking for Salesforce partner?