Summer 18 Release – Development Highlights

Salesforce released its latest features this summer of 2018.  I’ve gone through the 521 Pages release notes and providing you the summary of the features.  Heavily focused on Lightning, as usual, the norm in Salesforce releases now, I have split the highlights into 4 different posts: Lightning Experience Highlights, Development Highlights, Lightning App Builder Highlights, Lightning Flow Highlights.


Summer 18 – Lightning Experience Highlights

Summer 18 – Lightning App Builder Highlights

Summer 18 – Lightning Flow Highlights


This post is about Development Highlights.  

This post covers the summer 18 release features in the following Development topics:

  • Apex
  • Visualforce
  • Custom metadata types

APEX

Switch Statement

Apex now provides a switch statement that tests whether an expression matches one of several values and branches accordingly.
switch on expression {
    when value1 {	// when block 1
        // code block 1
    }	
    when value2 {	// when block 2
        // code block 2
    }
    when value3 {	// when block 3
        // code block 3
    }
    when else {		// when else block, optional
        // code block 4
    }
}

Developer Name for Record Types

You can use the following methods to get the developer name.

  • Schema.DescribeSObjectResult.getRecordTypeInfosByDeveloperName()
  • Schema.RecordTypeInfo.getDeveloperName()

SOQL Count() Function Doesn’t Count Toward Limits

Now, if a query using one of these functions returns an integer, it only counts as one query row toward the governor limit.  If a query using one of these functions returns an array of AggregateResult objects, only the total number of AggregateResult objects counts toward the limit.

For example, consider the following query.  Now, this query counts as only one query row toward the limit.

Integer countOfContacts = [SELECT COUNT() FROM Contact WHERE Account.Name = 'Edge Communications'];

Apex Code Size Limit Increased

The maximum amount of Apex code that you can use in an org has been doubled, from 3 MB to 6 MB. If your org was previously approved for an increase above 6 MB, it remains unchanged.

Apex Exception Email Recipients Can Receive Process and Flow Error Emails

Previously, the Apex Exception Email page was used only for Apex exceptions. Now you can also use it for process and flow error emails.

Opt Out of Collecting Code Coverage During Test Runs

Speed up Apex test runs by opting out of collecting code coverage information when you want faster feedback on a pass or fail status rather than coverage data. When you opt out, no data about Apex test coverage is stored.

Do one of the following:

  • From Setup, search for Apex Test Execution. Choose Select Tests, and select Skip Code Coverage.
  • From the Developer Console, select Test | New Run | Settings | Skip Code Coverage.

VISUALFORCE

Apply Lightning Experience Stylesheets

Lightning Experience Stylesheets feature introduced in Winter ’18 is now generally available.  To style your Visualforce page, set lightningStylesheets=”true” in the tag.

Lightning Experience Stylesheets Support Custom Theming

The lightningStylesheets attribute can incorporate your organization’s theme in your Visualforce pages. Style your page with Salesforce’s built-in themes or custom themes you create yourself.

Here’s an example of a Visualforce page with standard styles, used within Lightning Experience with a custom theme.

Visualforce page in Lightning Experience, before custom theme.

With theme support added to lightningStylesheets, every page is dressed up for the party.

Visualforce page in Lightning Experience, with custom theme.

 

To do so, set lightningStylesheets=”true” in the  tag and update the page’s API level to 43.0 or later.

Identify the Salesforce Theme That Users See

Detecting the Salesforce theme used to require multiple steps and utility functions. The streamlined process involves one new function: UITheme.getUITheme().

UITheme.getUITheme() returns a string that indicates the current user’s interface theme

function isLightningDesktop() {
  return UITheme.getUITheme === "Theme4d";
}

CUSTOM METADATA TYPES

Enable Access to Metadata Without Enabling Access to Data (Beta)

If a user requires access to metadata but not to data, enable the new Modify Metadata permission to give the access the user needs without providing access to org data. Users can create, edit, and delete org metadata but not org data. Users must have appropriate access rights to the metadata they’re trying to modify. Modify Metadata is enabled automatically when the Deploy Change Sets permission is selected.

For example, to deploy change sets, users previously had to have both the Deploy Change Sets permission and the Modify All Data permission. Users now need only the Deploy Change Sets permission and the Modify Metadata permission to deploy a change set.

Update Multiple Validation Rules with Custom Metadata Type Records (GA)

With custom metadata type records available to reference in validation rules, you don’t need to hard code values. Reference the records directly within the validation rules to avoid adding the same values to each rule.  Rather than update multiple validation rules that check a particular static value, reference a custom metadata record within the validation rules.

A .gif of a discount value being updated in a custom metadata type record.

When Change Sets Become Unavailable

A change set deployed from a source sandbox that you recently deleted or refreshed can temporarily appear available for deployment in the target org. The length of time that the change set appears deployable in the target org depends on how long it takes internal database cleanup processes to complete. When you delete or refresh the source sandbox, expect that the change set is no longer available for deployment in the target org.


Summer 18 – Lightning Experience Highlights

Summer 18 – Lightning App Builder Highlights

Summer 18 – Lightning Flow Highlights


 

Advertisement

3 Replies to “Summer 18 Release – Development Highlights”

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: