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

Saturday, October 6, 2018

Quick Highlights of the Winter ’19 Features

Connected Customer Experiences | Einstein | IoT




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


General

Get Feedback from Users on switching back to Salesforce Classic

With Winter '19 release, you can now collect feedback to find out why users are switching back to Salesforce Classic.

Lightning Experience > Setup > Onboarding & Assistance

Lightning Experience Configuration Converter

With Winter '19 release, Salesforce has introduced Configuration Converter for JavaScript buttons move to Lightning Experience.

Note: The Lightning Experience Configuration Converter is a standalone tool outside of Salesforce.



Lightning Usage App

With Winter '19 release, you can now view page performance by browser, mobile, Salesforce Classic and Lightning Experience in Lightning Usage App.

Note: The Lightning Usage App is not available for sandbox orgs.



Close All Tabs Keyboard Shortcut

With Winter '19 release, use the Shift+w keyboard shortcut to close all of your unpinned tabs at once.

External Objects in Lightning Console

With Winter '19 release, External Objects are now supported in Lightning Console.

Visualforce Overrides in Console Apps

With Winter '19 release, Visualforce Overrides (new, edit, view, tab, list, and clone) are now supported in console apps.

Field History Tracking Data for 18 months ONLY

With Winter '19 release, Salesforce will retain field history tracking data for up to 18 months ONLY.

Salesforce will no longer retain field history beyond 18 months. To retain field history longer, you can purchase the Field Audit Trail add-on.

reCAPTCHA form in Web-To-Lead

With Winter '19 release, you can use reCAPTCHA verification form in Web-to-Lead process to avoid spam leads.

Retain Edit Rights for Previous Opportunity Owners

With Winter '19 release, you can now retain the Edit rights for the previous owner.

Salesforce Live Message

With Winter '19 release, Customers can now contact support center via Text Messages and Facebook Messenger to get their issues resolved. Read more exciting features of Live Message.

Live Agent Setup Lightning Experience

With Winter '19 release, Live Agent Setup is now available in Lightning Experience.

Einstein Bots with No Code Required

With Winter '19 release, you can now call Flows and Send an Email as Actions in Dialogs.

Salesforce Mobile Apps SDK Supports Einstein Bots

With Winter '19 release, the Snap-ins SDK for iOS and Android now includes Einstein Bot support.

Create Cases in Salesforce from YouTube comments

With Winter '19 release, you can now connect YouTube channel directly to Service Cloud. You must have a Social Studio account to sync your YouTube account.

Service Cloud Mobile App

With Winter '19 release, Android and iOS versions of Service Cloud Mobile update to version 1.1.0. Service Cloud Mobile is now localised for your org’s default language. Also ability to post Salesforce Files to the case feed is now available in Android as well.

New Template "Help Center" in Communities

With Winter '19 release, you can create a public self-service help center and make knowledge base public for your customers.


Custom Metadata Types

Reference Custom Metadata Types in Advanced Formula Fields

With Winter '19 release, you can now reference custom metadata type records in an advanced formula field.

Edit Custom Metadata Type Records in Memory within Apex

With Winter '19 release, you can now instantiate and edit custom metadata records in memory within Apex. DML operations aren’t allowed on custom metadata in Apex. For DML operations, you have to use the Apex Metadata API.


Apex

Mark Apex Methods as Storable (Cacheable)

With Winter '19 release, you can now use Apex method as storable (cacheable) instead of using setStorable() on every JavaScript action.

To cache data returned from an Apex method for any component with an API version of 44.0 or later, annotate the Apex method with @AuraEnabled(cacheable=true)

@AuraEnabled(cacheable=true)
public static Account getAccount(Id accountId) {
    // your code here
}

Fire Platform Events from Batch Apex Classes (Beta)

With Winter '19 release, you can now fire Platform Events from Batch Apex Classes. This is currently a Beta feature.

To fire a platform event, a batch Apex class declaration must implement the Database.RaisesPlatformEvents interface.

public with sharing class YourSampleBatchJob implements Database.Batchable<SObject>, Database.RaisesPlatformEvents
   // your code here

}

Use Inherited Sharing to Secure Apex Code

With Winter '19 release, you can now specify the inherited sharing keyword on an Apex class, which allows the class to run in the sharing mode of the class that called it.

public inherited sharing class InheritedSharingClass{
// your code here

}

Streamline API Calls from Apex Code

With Winter '19 release, you can now use the new System.Url.getOrgDomainUrl() method to interact with Salesforce REST and SOAP APIs in Apex code. You can now also use the updated System.UserInfo.getSessionId() method to retrieve session IDs, even when your code runs asynchronously.

Http h = new Http();
HttpRequest req = new HttpRequest();  
req.setEndpoint(Url.getOrgDomainUrl().toExternalForm() + '/services/data/v44.0/limits');
req.setMethod('GET');
req.setHeader('Authorization', 'Bearer ' + UserInfo.getSessionId());

HttpResponse res = h.send(req);

Extend Functionality with the Callable Interface

With Winter '19 release, you can now use System.Callable interface enables you to use a common interface to build loosely coupled integrations between Apex classes or triggers.


Enterprise Messaging

High-Volume Platform Events (Pilot)

With Winter '19 release, Salesforce has made enhancements in high-volume platform events to publish and process millions of events efficiently.

Receive Streaming Events in Lightning Component

With Winter '19 release, you can now listen streaming events by embedding the lightning:empApi component.

Change Data Capture (Developer Preview)

Change Data Capture publishes change events, which represent changes to Salesforce records. Changes include creating a record, updating a record, deleting a record, and undeleting a record.

Visualforce

Securely Retrieve and Display Third-Party Images in Visualforce Pages

With Winter '19 release, you can now use the IMAGEPROXYURL function to securely fetch images outside Salesforce org’s server. 

<img src={!IMAGEPROXYURL("http://exampledomain.com/pic.png")}/>

<apex:image value="{!IMAGEPROXYURL("http://exampledomain.com/pic.png")}"/>

Improve Security by Isolating Untrusted Third-Party Content with iframes

With Winter '19 release, you can now isolate HTML static resources on a separate domain using iframes. 

To reference a static HTML file on a separate domain, use $IFrameResource.<resource_name> as a merge field, where resource_name is the name you specified when you uploaded the static resource.

URL Redirect Parameters Are No Longer Case-Sensitive

With Winter '19 release, URL parameters used in Visualforce pages—retURL, startURL, cancelURL, and saveURL—are no longer case-sensitive.


Deployment

Use Modify Metadata permission to Access to Metadata (Beta)

With Winter '19 release, you can now use a new permission "Modify Metadata" that enable access to Metadata without enabling access to Data. This is currently a Beta feature.

Deploy Using REST

With Winter '19 release, you can now use the Metadata REST API with all deployments. You need to have the Modify Metadata permission (currently in Beta) or the Modify All Data permission to perform deployments.




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

Useful Resources

Sunday, May 20, 2018

Quick Highlights of the Summer ’18 Features

Discover, Adopt, and Personalize | Modern and Intelligent User Experience



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

Encourage Users to Adopt Lightning Experience

With Summer '18 release, Users who have access to Lightning Experience are automatically switched from Salesforce Classic to Lightning Experience on a weekly basis.




New URL for Lightning Experience & Salesforce Mobile App

Salesforce Summer '18 release is coming with new URL format for Lightning Experience & Salesforce Mobile App.




Search the Object Easily & Faster

With Summer '18 release, you can now search to any searchable object simply by choosing or typing the object name in the dropdown.




Einstein Bots in Action!

With Summer '18 release, Einstein Bot is generally available to orgs with Service Cloud and Live Agent user licenses.




Perform Mass Quick Actions in Lightning Experience

With Summer '18 release, you can now use a mass quick action with cases, leads, accounts, campaigns, contacts, opportunities, work orders, and custom objects in Lightning Experience.

Communities: Lightning Community Template "Customer Service (Napili)" has a new Name

With Summer '18 release, Customer Service (Napili) is now called Customer Service.

Communities: Optimize Customer Community Site with Progressive Rendering

With Summer '18 release, You can specify in which order components are displayed when the page loads to optimize your site’s speed.

Communities: Lightning Bolt has a new Name

With Summer '18 release, Lightning Bolt is now renamed Lightning Bolt Solutions.

Communities: Community Users login with Passwordless login

With Summer '18 release, Community users can now login into your community with a verification code instead of a password.

Please read the details here

Related useful resources

Implement Passwordless Login and Verification Methods with Apex

Give Users Flexibility When Entering Phone Numbers

Enable Users to Review and Manage Their Verification Methods

Communities: Expire Community Links in Welcome Emails

With Summer '18 release, you can now set number of days to expire the links in Community Welcome emails.

Communities: Make Sure That Your Head Markup Is Valid

Starting with Summer ‘19 all existing code must be compliant for the <head> to function, and all new code must be compliant to be saved.

Communities: Sharing Sets for all Customer and Partner Licenses (Beta)

With Summer '18 release, You can now use sharing sets with the Customer Community Plus and Partner Community licenses (role-based community licenses). Previously, sharing sets were limited to Customer Community users ONLY.

Time Field Type (Generally Available)

With Summer '18 release, the Time field type is now generally available.

Retrieve Custom Setting List Views Using the Metadata API

With Summer '18 release, you can now retrieve custom setting list views using the Metadata API.

Rename Your My Domain

With Summer '18 release, you can now rename My Domain subdomain without contacting Salesforce Customer Support.

New Debug Mode for Lightning Components

With Summer '18 release, when debugging Lightning component JavaScript code, you can now enable debug mode only for the users who are actively debugging.

Lightning Component Library Is Generally Available

The Component Library is available at developer.salesforce.com/docs/component-library.

The Component Library is also available as an authenticated experience at 
https://<myDomain>.lightning.force.com/componentReference/suite.app

Where <myDomain> is the name of your custom Salesforce domain.

Lightning Experience Stylesheets to Visualforce Pages (Generally Available)

With Summer '18 release, the Lightning Experience Stylesheets feature is now generally available.

<apex:page lightningStylesheets="true" applyHtmlTag="false" applyBodyTag="false">

</apex:page>

The <body> tag has now Visualforce Scope in Lightning Experience

With Summer '18 release, the Visualforce page <body> element now includes the CSS scoping class slds-vf-scope when lightningStylesheets="true" in the <apex:page> tag.

<apex:page lightningStylesheets="true" applyHtmlTag="false" applyBodyTag="false">

<body class="slds-vf-scope">

    <!-- Your Lightning-styled Visualforce content -->

</body>

</apex:page>

Switch statement in Apex code!

With Summer '18 release, Apex now provides a switch statement :).

Get the DeveloperName for Record Types in Schema Describe

With Summer '18 release, Apex now has methods to help you get the developer name for record types more easily.

The SOQL Count() Function counts as only one query row toward the limit

With Summer '18 release, The SOQL count() function now counts as only one query row toward the limit.

Opt Out of Collecting Code Coverage Information During Test Runs

With Summer '18 release, you can quickly get the feedback on pass or fail status of test class rather than collecting coverage data.

The new @namespaceAccessible annotation for Packaging

With Summer '18 release, the new @namespaceAccessible annotation marks public or protected Apex as available to other packages that share a namespace.

Apex Code Size Limit Increased

With Summer '18 release, the maximum amount of Apex code in an org has been increased from 3 MB to 6 MB.

Metadata Coverage Report

Summer '18 is coming with Metadata Coverage report to analyse your org's metadata coverage information.

Referencing Custom Metadata Type Records in Validation Rules (Generally Available)

With Summer '18 release, you can now reference records of custom metadata typpe in Validation rules.

Chatter Desktop Is Being Retired in Summer ’18

Chatter Desktop is retiring in June 2018.

Files Connect for SharePoint On-Premises Is Being Retired

Files Connect for SharePoint On-Premises is scheduled for retirement in all Salesforce orgs as of May 18, 2018.

Files Sync Is Being Retired

Salesforce Files Sync is scheduled for retirement in all Salesforce orgs on May 25th, 2018.




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



Useful Resources