Summer'17 is here! - Development Changes

Summer'17 is here! - Development Changes

In this post, We will discuss about all major changes/enhancements done by Salesforce in development section. You can also check out all notes here

Lightning Components

LockerService Critical Update Activation

LockerService Enforcement Is Dependent on the API Version
LockerService is enforced for all Lightning components created after Summer ’17 (API version 40.0). LockerService isn’t enforced for components with API version 39.0 and lower, which covers any component created before Summer ’17.

Override Standard Actions with Lightning Components

At long last, you can override four of the standard actions on objects—View, New, Edit, and Tab—using Lightning components. You can override these actions on standard and custom objects. Overriding standard actions allows you to customize your org using Lightning components, including completely customizing the way you view, create, and edit records.

Lightning Data Service (Beta)

Lightning Data Service is now in beta. Use Lightning Data Service to load, create, edit, or delete a record in your component, without using Apex code. Lightning Data Service handles sharing rules and field-level security for you. Lightning Data Service also improves performance and user-interface consistency. It is like remote objects in VF pages.

With the move to beta, force:recordPreview has been deprecated and replaced with force:recordData. If you’re using force:recordPreview, you must refactor your components to use force:recordData.

<force:recordData aura:id="forceRecordCmp"
  recordId="{!v.recordId}"
  layoutType="{!v.layout}"
  fields="{!v.fieldsToQuery}"
  mode="VIEW"
  targetRecord="{!v.record}"
  targetFields="{!v.simpleRecord}" 
  targetError="{!v.error}" />
New Lightning Events
aura:valueRender

Indicates that a component has been rendered or rerendered. See Use the aura:valueRender Event Instead of a Custom Renderer.

force:tabClosed

Indicates that a tab in a Lightning console app has been closed successfully.

force:tabCreated

Indicates that a tab in a Lightning console app has been created successfully.

force:tabFocused

Indicates that a tab in a Lightning console app has been focused successfully.

force:tabRefreshed

Indicates that a tab in a Lightning console app has been refreshed successfully.

force:tabReplaced

Indicates that a tab in a Lightning console app has been replaced successfully.

force:tabUpdated

Indicates that a tab in a Lightning console app has been updated successfully.

lightning:sendChatterExtensionPayload (Pilot)

Updates the payload and metadata that must be saved during extension composition. See Integrate Your Custom Apps into the Chatter Publisher (Pilot).

wave:update

Dynamically sets the filter on a Wave Dashboard, or interacts with the dashboard by dynamically changing the selection.

wave:selectionChanged

This event is fired by a Wave dashboard and contains information about the selection made by the user.

Visualforce

Use Advanced PDF to Render Visualforce Pages as PDF Files (Pilot)

Advanced PDF renders Visualforce pages as PDF files with broader support for modern HTML standards, such as CSS3, JavaScript, and HTML5. This change applies to both Lightning Experience and Salesforce Classic.

To use Advanced PDF, set renderAs="advanced_pdf" in the tag of a Visualforce page with API version 40.0 or later. This process is similar to the existing process for rendering a Visualforce page as a standard PDF file.

Because the rendered PDF is optimized for printed pages, by default it does not preserve background colors and images. To preserve background colors and images, add a line to your page’s CSS.

@media print { -webkit-print-color-adjust: exact; }
Access Visualforce Page Metrics Using the SOAP API

Make a SOQL query in Workbench to get information from the VisualforceAccessMetrics object. This is a sample SOQL call.

SELECT ApexPageId,DailyPageViewCount,Id,MetricsDate FROM VisualforceAccessMetrics

Each VisualforceAccessMetrics object tracks the daily page view count in the DailyPageViewCount field. The date the metrics were collected is specified in MetricsDate, and the ID of the tracked Visualforce page is specified in ApexPageId. Page views are tallied the day after the page is viewed, and each VisualforceAccessMetrics object is removed after 90 days.

Using VisualforceAccessMetrics, you can track the number of views each Visualforce page in your org receives in a 24-hour time period. To find out how many views a page got over the course of multiple days, you can query multiple VisualforceAccessMetrics objects for the same ApexPageId.

Apex

Retrieve and Deploy Metadata in Apex

Salesforce uses metadata types and components to represent org configuration and customization. Metadata is used for org settings that admins control, or configuration information applied by installed apps and packages.
Previously, accessing metadata required using the Metadata API, but you can now use classes in the Metadata namespace to access metadata components from Apex code.

Metadata access in Apex is currently limited to custom metadata records and page layouts. You can retrieve, create, or update custom metadata, but you cannot delete metadata through Apex.

For more information and examples of how to deploy and retrieve metadata in Apex, see the Metadata feature documentation

API

Salesforce Object Search Language (SOSL) includes a new WITH SPELL_CORRECTION clause, and support for custom objects and fields using the WITH HIGHLIGHT clause.

WITH HIGHLIGHT Supports Custom Fields and Objects

Highlighting makes it easier for users to identify content. Specify which custom fields and objects are highlighted in search results.

FIND {Salesforce West} IN ALL FIELDS RETURNING Building__c(Name, BuildingDescription__c) WITH HIGHLIGHT
Disable Spell Correction on a Search Query with WITH SPELL_CORRECTION

Use WITH SPELL_CORRECTION = false to disable spell correction on a search query. When set to true, spell correction is enabled for searches that support spell correction. The default value is true.

FIND {San Francisco} IN ALL FIELDS RETURNING Account WITH SPELL_CORRECTION = false
New Resource: Record Count

Retrieve record counts for objects with this new REST API resource. Example:

/services/data/v40.0/limits/recordCount?sObjects=Account,Contact

Custom Metadata Type

Add Validation Rules for Custom Metadata Type Fields

Use validation rules within custom metadata type fields just as you do for non-custom metadata type fields. You can also create validation rules for relationship fields.

For example, let’s say you create a custom metadata type named Employee Records. The type contains the relationship field Feedback__c, which has an entity relationship. You can create a rule that traverses the relationship to check if the related object is a custom object or field.

EQUALS(RIGHT(Feedback__r.QualifiedApiName, 3), '__c')
Support Long Text Areas (Generally Available)

Community

Embedded Login Enables Users to Log In to Your Website

Salesforce introduces the Embedded Login feature to authenticate your website’s visitors. Your web developers can add login capabilities to the website with just a few lines of HTML. Embedded Login connects your website with Salesforce. This feature works for communities created with either our Communities or Salesforce Identity products. This feature is new in both Lightning Experience and Salesforce Classic.

Embedded Login

Lakshay Katney Avatar

Lakshay Katney

Saleforce developer by profession but I like to work with various technologies.I blog about Force.com, Hybrid Apps, PhoneGap, AngularJS, BackboneJS, JavaScript in general. I am Angular & NodeJS fan.

Read More
Share this page
Top 15 Posts