Friday, December 21, 2018

@RemoteAction Static methods with Inheritance, Composition & Polymorphism



This blog post is specifically highlighting an issue of @RemoteAction Static methods with Inheritance, Composition and Polymorphism.

You may read Inheritance, Composition over Inheritance and Polymorphism.


Hypothetical Scenario:

Universal Digital (UD) is a global internet, web, and domain hosting service provider organisation. They are planning to move their current solution on the Cloud. After analysing various software’s, they have chosen Salesforce. It will be a completely custom solution on Lightning platform. Initially two (2) regions: EMEA and NA will be going live in MVP phase.

The solution would be fully custom, the CTO of UD has given some benchmarks for the development. The most important one is that the code should be divided into two (2) parts:
  • Global Repository
    • It will have ONLY common code that will be same across Regions (EMEA, NA).
  • Regional Repository
    • Every Region (EMEA, NA) will have its own code repository where it will have Region specific code + Global common code.

Problem:

Development team is having issues specifically for @RemoteAction methods as developers are using heavily custom framework to build custom smart UI. So, Development team is struggling to find a way that how to use RemoteAction Static methods with Inheritance, Composition & Polymorphism?

Considerations of "Virtual", "Override" and "Static" Keywords in Apex

  • RemoteAction methods must be declared as "Static".
  • You can't use "Virtual" and "Override" keywords with "Static" keyword.

So specifically for @RemoteAction methods Development team needs to take a slightly different approach.



Please see an example of Remote Action Methods and Inheritance in detail by Salesforce.

Solution:

(1) How to Re-Use a Common base class @RemoteAction Static method for a Region (EMEA, NA)




(2) How to Extend a Common base class @RemoteAction method for a Region (EMEA, NA)

Approach 1


In this approach you are limited in Common base class and you can't Override any of the Common method in Region specific classes.



Approach 2

In this approach you have flexibility. You can Extend and Override the methods of Common class in a Region specific classes.




Monday, December 17, 2018

Quick Highlights of the Spring ’19 Features

Lightning Web Components | Authentication & Identity | Salesforce IoT


As we all know Salesforce announces Seasonal Releases three (3) times a year. Spring '19 release notes are now publicly available. Spring '19 release is coming with enhancements and new exciting features!.


List View with Pinned Lists in Lightning Experience

In Spring ’19 release, with Pinned Lists, all users can make any List View their new default.

Print a Record Detail Page in Lightning Experience

With Spring ’19 release, you can now Print record detail and related lists from a record page in Lightning Experience. You can disable the Printable View button feature from the record page layout.

Thanks Badges in Lightning Experience (Pilot)

With Spring '19 release, you can now give thanks badges to users from Chatter feed.

Data Storage is Increasing

With Spring '19 release, data storage will be increasing for selected editions. For example: Now, a Professional Edition org will be increasing from 1 GB to 10 GB.

Note: Orgs will begin to see the increase beginning in late March 2019.

Hyperlinks in Formula Fields in Lightning Experience

With Spring '19 release, the critical update ensures that the target value for hyperlinks is honoured, whether it’s explicitly configured or set by default.


Note: This critical update is enabled in Summer ’19 on May 17, 2019.

Update to Retention Limit for Field History Data

With Spring '19 release, the process will be beginning to remove the field history data older than 24 months. This policy applies to all orgs created after June 1, 2011 who have not purchased the Field Audit Trail (FAT) add-on.

Legacy Territory Management Is Being Retired

The original territory management feature is scheduled for retirement as of Summer ’20.

Exciting & Cool features of Calendars in Lightning Experience

With Spring '19 release, you can now Schedule Repeat Events. There are other cool features of Calendars in Lightning Experience.
  • Public Calendars in Lightning Experience
  • Book Resources for Events
  • Add Attendees Without Setting Up Lightning Sync
  • See More Details from the Event Preview
  • See Files Related to Your Events
  • Print Calendars in Lightning Experience

New Languages in Pardot

With Spring '19 release, Pardot user interface can now be translated into French, German, and Spanish (EU) languages.

Einstein Case Classification

With Spring '19 release, Einstein Case Classification can recommend or populate picklist and checkbox field values based on the previous data.

Einstein Bots: Top Intent Conflicts

With Spring '19 release, you can now evaluate quality of your bot’s intent model and a detailed look at individual intents.

Einstein Bots: Customer Input Classification and Feedback

With Spring '19 release, you can now classify customers type in chat and then approve, ignore, or reclassify each input to the proper intent.

Einstein Bots: with Mobile Messaging (LiveMessage SMS) Channel

With Spring '19 release, you can now use Einstein Bot with LiveMessage SMS text messaging channel in addition to the Live Agent chat channel.

Einstein Bots: Channel Settings in the Bot Builder

With Spring '19 release, you can now deploy your Bot quickly and easily from your Bot’s Overview page.

Einstein Bots: New Context and System Variable 

With Spring '19 release, you can now build channel independent Bots with new context and system variables.

Einstein Bots: Improved Performance Dashboard

With Spring '19 release, you have now more options to understand your Bot’s performance: Filter by date and channel (chat, messaging), Top Last Dialogs, Escalation Success, Einstein Intent Usage, and Interactions.

Einstein Bots: New Terminology "Utterance"

With Spring '19 release, a term has been introduced "utterance" and that is different from customer input.

Einstein Next Best Action (Generally Available)

With Spring '19 release, Einstein Next Best Action is generally available. It helps to suggest spot-on recommendations.

Videos in Knowledge Articles

With Spring '19 release, you can now add ooyala.com videos to the list of supported domains for embedding videos in both Salesforce Classic and Lightning Experience.

Communities: Customers Request a Call from Support

With Spring '19 release, your community users can now request that customer support call them back.

Guest Users (without logging in) to Run Flows

With Spring '19 release, Users can now run a flow without logging in.

Use Custom Lightning Web Components in Communities

With Spring '19 release, you can now build custom New Lightning Web components that admins can drag onto community pages.

Lightning Container Components in Communities

With Spring '19 release, you can now integrate your existing or new applications built in React, Angular, Vue, or other third-party JavaScript frameworks or open-source software with lightning:container in Lightning applications and Communities.

Sharing Sets with Campaigns, Opportunities, and Orders (Generally Available)

With Spring '19 release, you can now grant portal or community users access to campaigns, opportunities, and orders using sharing sets.

Sharing Sets with Contacts with Multiple Accounts (Generally Available)

With Spring '19 release, you can now create a sharing set that grants access to all records with a lookup to any accounts related to the contact.

Customize Verify Page for Community Sign-Ups

With Spring '19 release, you can now customize your Verify page’s layout and text with Visualforce and a couple of Apex methods.

Flow Builder: Intuitive & Faster Flow Building Tool

With Spring '19 release, Cloud Flow Designer is being replaced by a streamlined and with a much faster tool.

Please read other exciting tools of Lightning Flow.

Permission Set Groups (Pilot)

With Spring '19 release, you can combine multiple permission sets into a single permission set group based on the tasks that a user regularly performs.

Multiple Permission Sets

Permission Set Group

Globalization: New Languages

With Spring '19 release, 10 new languages and locales for South African and Indian customers have been added as platform languages.

Globalization: Right-to-Left Languages (Beta)

With Spring '19 release, Right-to-left language and layout is available for Arabic, Hebrew, and Urdu.
  • Arabic and Hebrew are now available as end-user languages in Lightning Experience.
  • Urdu is supported as a platform language.
Urdu Language as Platform Language!





Create Custom Big Objects from Setup


With Spring '19 release, as you know you can create Big Objects from Metadata API but you can also now create Big Objects manually from Setup.

Create Objects from Spreadsheets

With Spring '19 release, you can now create a custom object by importing its fields and field data from a Google sheet, a Quip spreadsheet, an .xls file, or a .csv file.

Check a Field’s References (Beta)

With Spring '19 release, you can now view the references to a custom field (in a sandbox org) before you Edit or Delete it.

Reserved Apex Names in External Services Schema

With Spring '19 release, you can now use avoided words like, including “end,” number,” object,” and “transaction." as your external services schema variable names.

Namespace Prefix to pageReference.state Properties and Query Parameters

With Spring '19 release, the query parameters and pageReference.state properties must have namespace prefixes.

Authentication and Identity: Identity-First Login Page with My Domain Login Discovery

With Spring '19 release, you can now create interview-based or identity-first login page with My Domain Login Discovery where user will be asked to enter a custom unique identifier such as an email address or phone number instead of username and password and sends them directly to the identity provider (IdP) login page to authenticate.

Spring '19 is coming with many new features for authentication and identity.
  • Authenticate Users with Certificates
  • Connected App Integrations with OAuth 2.0 Endpoints (Generally Available)
  • New Size Requirement for Client Secrets (Consumer Secrets) for OAuth 2.0 Connected App
  • Customize Verify Page for Community Sign-Ups
  • Send Asynchronous Email Verifications
  • Create Lightweight Contactless External Identity Users (Generally Available)
  • View and Revoke Access to Devices with Device Management (Beta)

Shield Platform Encryption: Encrypt Data in Custom Rich Text Area Fields (Generally Available)

With Spring '19 release, you can now encrypt custom rich text area fields.

Shield Platform Encryption: Exact Match Case-Insensitive Deterministic Encryption (Beta)

With Spring '19 release, you can now use the same capabilities as deterministic encryption but with exact, case-insensitive matching.

Shield Platform Encryption: Encrypt Einstein Discovery Data (Pilot)

With Spring '19 release, you can now encrypt sensitive Einstein Discovery data with Shield Platform Encryption.

Spring '19 is coming with many other features of Shield Platform Encryption.

Salesforce IoT: With Service Cloud Unlimited Edition

With Spring '19 release, Salesforce IoT is now included in Service Cloud at no additional cost.

Development: Lightning Web Components (Generally Available)

With Spring '19 release, you can now build Lightning Components with new programming model "Lightning Web Components". The "Aura Components" model still exist and work with the new model.

Development: Locker Service is now Lightning Locker

With Spring '19 release, Locker Service is now renamed as Lightning Locker.

Development: Must use Square Brackets for Array, Set, and List Attributes

With Spring '19 release, to set a default value for these attribute types you must use surround Square Brackets [] and comma-separated values.

Development: Notify about Unsaved Changes


With Spring '19 release, you can now use lightning:unsavedChanges in standard and console navigation apps to notify UI about unsaved changes.

Development: Enforce Field-Level Security Permissions for SOQL Queries (Beta)

With Spring '19 release, you can use WITH SECURITY_ENFORCED clause to enable checking for field- and object-level security permissions on SOQL SELECT queries.

SELECT Id, Name, Parent.Website FROM Account WITH SECURITY_ENFORCED

Enterprise Messaging: Change Data Capture & High-Volume Platform Events (Generally Available)

With Spring '19 release, the Change Data Capture (CDC) and High-Volume Platform Events are now generally available.

Sandboxes: Cloning Sandboxes (Generally Available)

With Spring '19 release, clone an existing sandbox feature is now generally available.

Sandboxes: Format of User Email Addresses is changing in Sandboxes

With Spring '19 release, Salesforce will append ".invalid" to all user email addresses when you create or refresh a sandbox. For example: john@unversal.com becomes john@unversal.com.invalid.





Spring '19 release has lots of other exciting and interesting features but these are just few of them. Please read the Spring '19 release notes for details.


Useful Resources