#Salesforce #Release #Summer20 #Lightning #Developers #BeReleaseReady

1. Communicate Across Salesforce UI Technologies with Lightning Message Service (Generally Available)

// publisherComponent.js
import { LightningElement, wire } from 'lwc';
import { publish, MessageContext } from 'lightning/messageService';
import SAMPLEMC from "@salesforce/messageChannel/SampleMessageChannel__c";
export default class PublisherComponent extends LightningElement {
@wire(MessageContext)
messageContext;
handleClick() {
const message = {
recordId: "001xx000003NGSFAA4",
recordData: {
value: "Burlington Textiles Corp of America"
}
};
publish(this.messageContext, SAMPLEMC, message);
}
}
<apex:page>
<div>
<p>Subscribe to SampleMessageChannel</p>
<button onclick="subscribeMC()">Subscribe</button>
<p>Unsubscribe from SampleMessageChannel</p>
<button onclick="unsubscribeMC()">Unsubscribe</button>
<br/>
<br/>
<p>Received message:</p>
<textarea id="MCMessageTextArea" rows="10" style="disabled:true;resize:none;width:100%;"/>
</div>
<script>
// Load the MessageChannel token in a variable
var SAMPLEMC = "{!$MessageChannel.SampleMessageChannel__c}";
var subscriptionToMC;
// Display message in the textarea field
function onMCPublished(message) {
var textArea = document.querySelector("#MCMessageTextArea");
textArea.innerHTML = message ? JSON.stringify(message, null, '\t') : 'no message payload';
}
function subscribeMC() {
if (!subscriptionToMC) {
subscriptionToMC = sforce.one.subscribe(SAMPLEMC, onMCPublished});
}
}
function unsubscribeMC() {
if (subscriptionToMC) {
sforce.one.unsubscribe(subscriptionToMC);
subscriptionToMC = null;
}
}
</script>
</apex:page>

2. Get Information About the Current Lightning Community

import communityId from '@salesforce/community/Id';
import communityBasePath from '@salesforce/community/basePath';

3. Develop Flow Screen Components That Work for Multiple Objects (Beta)

4. Control How to Serialize and Deserialize Apex Types

  • never: never allowed
  • sameNamespace: allowed only for Apex code in the same namespace
  • samePackage: allowed only for Apex code in the same package (impacts only second-generation packages)
  • always: always allowed for any Apex code
@JsonAccess(serializable='never' deserializable='sameNamespace')
public class Foo {}

5. Enrich Change Event Messages with Extra Fields (Beta)

{
"FullName": "SalesEvents_AccountChangeEvent",
"Metadata": {
"enrichedFields": [
{
"name": "External_Account_ID__c"
},
{
"name": "Industry"
}
],
"eventChannel": "SalesEvents__chn",
"selectedEntity": "AccountChangeEvent"
}
}

6. Lightning Web Components in Custom Tabs Are Reactive

export default class PageStateChangeExample extends NavigationMixin(LightningElement) {
// Declare the currentPageReference variable in order to track it
currentPageReference;
@wire(CurrentPageReference)
setCurrentPageReference(currentPageReference) {
this.currentPageReference = currentPageReference;

7. Restrict Access to @AuraEnabled Apex Methods for Authenticated Users Based on User Profile (Security Alert)

8. New and Changed Lightning Web Components

Changed Lightning Web Components

  • icon-alternative-text — The alternative text used to describe the icon, which is displayed as tooltip text.
  • icon-name — The Lightning Design System name of the icon to display inside the badge. Specify the name in the format utility:down where utility is the category, and down is the specific icon to be displayed.
  • icon-position — The position for the icon inside the badge. Specify the value start to display the icon before the text or end to display it after the text. The default is start.
  • blur() — Removes focus on the link.
  • focus() — Sets focus on the link.
  • column-widths-mode — Specifies how column widths are calculated. Set to fixed for columns with equal widths. Set to auto for column widths based on the width of the column content and the table width. The default is fixed.
  • hideDefaultActions — Specifies whether the default header actions are available on a column. The default is false.
  • The commit event is supported.
  • Shortcuts k, K, m, and M are allowed. For example, in the en-US locale, when you enter 1k the field displays 1,000. Entering 1m results in 1,000,000. When the input field is focused, it displays the multiplied number. For example, entering 1k results in 1,000 on blur, and 1000 when the input is focused again. You can’t use these shortcuts when programmatically assigning input values to the value attribute.
  • On the current month view of the date picker, you can now select a date from the previous and next month. Previously, dates from the previous and next month were disabled on the current month view unless you navigated directly to those months.
  • The names for months and weekdays in the date picker now use your Salesforce language setting. Previously, these names used your locale setting.
  • On the current month view of the date picker, you can now select a date from the previous and next month. Previously, dates from the previous and next month were disabled on the current month view unless you navigated directly to those months.
  • The names for months and weekdays in the date picker now use your Salesforce language setting. Previously, these names used your locale setting.
  • The suffix constituent field is now supported. To enable this field, from Setup enter User Interface in the Quick Find box, then select User Interface. In Lightning Experience, the User Interface page is the last item under the User Interface node. On the User Interface page, select Enable Name Suffixes for Person Names.
  • map-markers — HTML tags you include in the title and description properties are not supported for security reasons. The tags are displayed as unescaped markup in the location list and the info window.
  • focus — Apply focus on the tab that’s currently selected.
  • button — Displays a button using lightning-button.
  • button-icon — Displays a button icon using lightning-button-icon.

9. Check User Permissions for Lightning Web Components

import hasPermission from '@salesforce/userPermission/PermissionName';
import hasPermission from '@salesforce/customPermission/PermissionName';
import hasPermission from '@salesforce/customPermission/namespace__PermissionName';
// app.js
import { LightningElement } from 'lwc';
import hasViewSetup from '@salesforce/userPermission/ViewSetup';
export default class App extends LightingElement {
get isSetupEnabled() {
return hasViewSetup;
}
openSetup(e) {...}
}
<!-- app.html --><template>
<setup-panel-group>
<setup-button disabled={isSetupEnabled} onclick={openSetup}></setup-button>
</setup-panel-group>
</template>
// app.js
import { LightningElement } from 'lwc';
import hasViewReport from '@salesforce/customPermission/acme__ViewReport';
export default class App extends LightingElement {
get isReportVisible() {
return hasViewReport;
}
}
<!-- app.html --><template>
<common-view></common-view>
<template if:true={isReportVisible}>
<c-expense-report></c-expense-report>
</template>
</template>

10. Create Relationships to Entity Particles from Custom Metadata Types

Say Hello To Me On Twitter | Facebook | Linkedin | MyBlog | Blogger | MyWebsite

#HappyLearning #Platform #SalesforceDeveloper #BeReleaseReady #Salesforceguy

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Swayam Chouksey

Salesforce Evangelist || Blockchain Enthusiast || Architect || Trainer || Blogger || Believes in turning Ideas to reality || Day Dreamer || Happy Person