February'16 SDG - Spring'16 new features

12

Click here to load reader

Transcript of February'16 SDG - Spring'16 new features

Page 1: February'16 SDG - Spring'16 new features

Spring'16 new featuresJosep Vall-llovera - CTO at Clapps

26/02/2016

@valnavjo Valnavjo in/jvn84 Valnavjo

Page 2: February'16 SDG - Spring'16 new features

Introduction

2

Page 3: February'16 SDG - Spring'16 new features

Index of contents

3

1. Deployment 2. Development

1.1. Sandbox Enhancements 2.1. Custom Metadata Types

2.2. Visualforce

2.3. Apex Code

2.4. Lightning Components

2.5. API

Page 4: February'16 SDG - Spring'16 new features

1.1. Sandbox Enhancements

4

● Increased Developer Sandbox Licenses.○ Enterprise Edition: from 1 to 25.○ Unlimited Edition: from 15 to 50.○ Performance Edition: from 30 to 100.

● Run Script After Sandbox Creation and Refresh.○ Selects the best instance based on available storage space and CPU consumption.○ Divides your organization’s data into small chunks (processed in parallel).○ Prod org may change during copy. The new automated post-copy fixes data

inconsistencies after copying is complete.○ Monitor progress of your sandbox copy. Progress bar: in the queue, in process, or recently

completed. View the percentage completed. Details page.

Page 5: February'16 SDG - Spring'16 new features

2.1. Custom Metadata Types

5

● Migrate app configuration records even more effectively with added support for picklists, upsert, and more.

● Bulk Create Custom Metadata Records.○ Use the custom metadata loader to bulk load custom metadata records to Salesforce from

a .csv file.○ Demo app.

● Added Support for Custom Picklist Fields (Beta).○ You can now include custom picklist fields in your custom metadata types.

● Upsert Custom Metadata Records.○ Tired of worrying about duplicate record creation? :)

Page 6: February'16 SDG - Spring'16 new features

2.2. Visualforce

6

● {!User.UITheme} and UserInfo.getUiTheme() to Determine User Experience Context. New values:

○ Theme4d—Modern “Lightning Experience” Salesforce theme.○ Theme4t—Salesforce1 mobile Salesforce theme.

● getContent() and getContentAsPDF() methods behave as callouts - Critical Update Postponed.○ The auto-activation date has been postponed until Summer ’16.

● Serve static resources from the Visualforce domain - Critical Update Postponed.○ The auto-activation date has been postponed until Summer ’16.

Page 7: February'16 SDG - Spring'16 new features

2.3. Apex Code (1)

7

● Create More Robust Apex Tests and More Flexible Test Runs○ Create Test Suites of Commonly Used Apex Test Classes.

■ Create test suites that contain sets of test classes that will run together.■ Create/Run it from Dev Console: Test | New Suite / Test | New Suite Run.■ Available in SOAP, REST, and Tooling APIs by an ApexTestSuite object.

○ Stop a Test Run That’s Failing Miserably■ Set Number of failures from Dev Console: -1 means all tests, 0 means you allow one

failure, 1 means you allow 2 failures.○ Set and Modify the CreatedDate Field in Apex Tests.

■ System.Test.setCreatedDate method.○ Compare Currency to Decimals in Apex Tests.

■ Bug fixed!

Page 8: February'16 SDG - Spring'16 new features

2.3. Apex Code (2)

8

● Locate Jobs in the Apex Flex Queue.○ SELECT JobPosition FROM FlexQueueItem WHERE JobType = 'BatchApex' AND AsyncApexJobId = '707xx000000DABC'○ SELECT AsyncApexJobId FROM FlexQueueItem WHERE JobType = 'BatchApex' AND JobPosition = '2'

● Changed Apex Classes.○ System class:

■ New method: isQueueable()■ Changed method: isBatch()

● New Apex Interfaces.○ System.SandboxPostCopy Interface. Complete tasks after a sandbox is created or

refreshed (global void runApexClass(SandboxContext context);).

Page 9: February'16 SDG - Spring'16 new features

2.4. Lightning Components

9

● Dynamically Populate Label Parameters with format().○ $Label.c.myLabel, with a value of Hello {0} and {1}○ {!format($Label.c.myLabel, v.attribute1, v.attribute2)}

● $A.error() Is Deprecated.○ Use throw new Error("Your error message here") instead.

● Debug Lightning Components with the Salesforce Lightning Inspector.○ Google Chrome DevTools extension.

● Resolved Errors with Apex Controllers with List or Map Parameters.○ UnsupportedOperationException fixed when component called a server-side Apex

controller method and sent a List or Map object as a parameter.

Page 10: February'16 SDG - Spring'16 new features

2.5. API

10

● SOQL.○ allPrivate query scope to find reports and dashboards saved in all users’ private folders.

■ SELECT Id FROM Report USING SCOPE allPrivate WHERE OwnerId = '005A0000000Bc2deFG'○ DISTANCE() Support with Location-based SOQL.

■ SELECT Id, Name, Location, DISTANCE(Location, GEOLOCATION(latitude, longitude), 'mi') FROM CONTACT;○ These fields now reflect the appropriate format for the given user locale.

■ SELECT FORMAT(amount) Amt, FORMAT(lastModifiedDate) editDate FROM Opportunity● Retirement of Endpoint Routing for API Logins.

○ Only affects API login traffic. API endpoint must be changed from www.salesforce.com to https://login.salesforce.com.

● Streaming API.○ Replay Generic Streaming Events (Generally Available).○ Replay PushTopic Streaming Events (Beta).

● Tooling API, Metadata API.

Page 12: February'16 SDG - Spring'16 new features

Thanks!

Q&A12