Slide 1

Slide 1 text

Everything that's Awesome with Apex Dreamforce ’18 September 26, 2018 Chris Peterson Aaron Slettehaugh

Slide 2

Slide 2 text

Aaron Slettehaugh Product Management, Salesforce Platform Chris Peterson Product Management, Salesforce Platform

Slide 3

Slide 3 text

Forward-Looking Statements Statement under the Private Securities Litigation Reform Act of 1995 This presentation may contain forward-looking statements that involve risks, uncertainties, and assumptions. If any such uncertainties materialize or if any of the assumptions proves incorrect, the results of salesforce.com, inc. could differ materially from the results expressed or implied by the forward-looking statements we make. All statements other than statements of historical fact could be deemed forward-looking, including any projections of product or service availability, subscriber growth, earnings, revenues, or other financial items and any statements regarding strategies or plans of management for future operations, statements of belief, any statements concerning new, planned, or upgraded services or technology developments and customer contracts or use of our services. The risks and uncertainties referred to above include – but are not limited to – risks associated with developing and delivering new functionality for our service, new products and services, our new business model, our past operating losses, possible fluctuations in our operating results and rate of growth, interruptions or delays in our Web hosting, breach of our security measures, the outcome of any litigation, risks associated with completed and any possible mergers and acquisitions, the immature market in which we operate, our relatively limited operating history, our ability to expand, retain, and motivate our employees and manage our growth, new releases of our service and successful customer deployment, our limited history reselling non-salesforce.com products, and utilization and selling to larger enterprise customers. Further information on potential factors that could affect the financial results of salesforce.com, inc. is included in our annual report on Form 10-K for the most recent fiscal year and in our quarterly report on Form 10-Q for the most recent fiscal quarter. These documents and others containing important disclosures are available on the SEC Filings section of the Investor Information section of our Web site. Any unreleased services or features referenced in this or other presentations, press releases or public statements are not currently available and may not be delivered on time or at all. Customers who purchase our services should make the purchase decisions based upon features that are currently available. Salesforce.com, inc. assumes no obligation and does not intend to update these forward-looking statements.

Slide 4

Slide 4 text

Compiler rollout is complete Back to your regularly-scheduled roadmap

Slide 5

Slide 5 text

What's New A Recap of Summer '18 and Winter '19

Slide 6

Slide 6 text

Switch Statement 17,110 Points • Switch on most primitive types • Switch on a generic SObject instance • Use multiple literals for the same ‘when’ condition COUNT() Queries Without Worrying About Limits 7,010 Points • Count queries only consume one query row for limit purposes RecordTypeInfo.getDeveloperName() 4,990 Points • Get Record Type API names without a SOQL query Apex Code Size Limit Increase 360 Points • Organizations default to 6MB of Apex non-test code storage, up from 3MB Instantiate Custom Metadata Types in Apex • Construct and edit custom metadata fields in memory without DB update 30,000 IdeaExchange Points Quality of Life

Slide 7

Slide 7 text

IdeaExchange 30,000 points!

Slide 8

Slide 8 text

Compile On Deploy • Apex will automatically recompile as part of metadata deployments to production organizations • Avoids performance overhead on first use from "cold cache" • Opt-in for sandbox and developer edition orgs Skip Test Coverage Calculation • Optionally bypass collecting fine-grained test coverage data for faster test execution • One less barrier to test-driven-development patterns Deployment Cache • Tests make better use of cache • Faster deployment times Always looking out for improvements Performance

Slide 9

Slide 9 text

Detailed, actionable error reporting for Batch Apex Introducing: Batch Apex Error Events Batch Error Events include: • AsyncApexJobId • All recordIds in scope for the job chunk • Exception type • Exception message • Stack trace • RequestId (correlate with Event Monitoring data) Dramatically improved visibility into issues • Know which records were committed and which to retry Programmatically react to errors in real-time • Retry failed jobs - enqueue jobs from your event handler (if you want) Log with all the verbosity you could ever want • Full context available in events, including impacted records • For Iterator-based jobs, the Object.toString() value is used Opt-in, doesn't count for limits • To opt-in, implement Database.RaisesPlatformEvents • Standard platform event type doesn't count aginst org limits

Slide 10

Slide 10 text

How's it work?

Slide 11

Slide 11 text

How's it work? throws SObjectException if field is invalid

Slide 12

Slide 12 text

How’s it work?

Slide 13

Slide 13 text

What's Next A Sneak Peak at Spring '19 and Beyond

Slide 14

Slide 14 text

Where we are investing ● Security ● Quality of life (true to the core) ● Language server ● Asynchronous Apex ● Platform Cache

Slide 15

Slide 15 text

Coming soon (Spring ‘19, Summer '19) Better visibility of Org Limits • Daily Async Apex Executions • Daily API Requests • Data & File Storage • … everything else sfdx force:limits:api:display / Rest API shows you Platform Cache available in scratch orgs • Platform cache capacity as a scratch org feature • [Optional] Automatically shrink deployed partitions to 1MB • Reduced minimum partition size to allow testing multiple partitions Refactoring support in Apex Language Server (Visual Studio Code) • Rename Symbol CRUD/FLS checks

Slide 16

Slide 16 text

Coming less soon Apex Language Server: expanded refactoring • Implement missing interface methods • Extract variable Platform Cache: Apex Metadata API Support • Allow ISV applications to automatically provision cache in post-install • Programatically re-configure cache partition sizing as needed Anonymous Inner Classes • Long-requested feature to cut down on boilerplate code Async enhancements • Continued batch robustness and visibility enhancements • Fast queueable • Consolidate futures and queueable

Slide 17

Slide 17 text

Security Review and You

Slide 18

Slide 18 text

Why? • A secure by default flexible sharing mode • Make developer intent explicit • Breeze through AppExchange Security Review What? • Sharing mode is inherited from calling class • If entry point, then sharing mode will be with sharing When? • Service layer classes, even if global • General use utility classes • Keep your controller classes with sharing New sharing mode in Winter '19 Inherited Sharing

Slide 19

Slide 19 text

Inherited sharing in practice Apex Entry Point:

Slide 20

Slide 20 text

How's it different? Apex Entry Point:

Slide 21

Slide 21 text

Object and Field level security Roll-your-own security means 1. Lots of boilerplate code 2. Security gaps (inadvertently or intentionally ignored) 3. Performance overhead 4. Difficult to audit: ○ requires advanced static analysis tools ○ long security review cycles ○ higher risk of failing security review (see #2) FLS/CRUD

Slide 22

Slide 22 text

FLS/CRUD Soon (Spring ‘19) WITH SECURITY_ENFORCED ● straightforward ● blunt tool Later SObjectAccessDecision Security.stripInaccessible(AccessType accessCheckType, List target) //Not finalized syntax ● gives dev more control ● requires more skill Access check enforcement roadmap  

Slide 23

Slide 23 text

Resources

Slide 24

Slide 24 text

Apex in Trailhead Advanced Beginner Intermediate Apex Enterprise Patterns: Domain & Selector Layers Apex Enterprise Patterns: Service Layer Apex Metadata API Apex Specialist Advanced Apex Specialist Apex & .NET Asynchronous Apex Asynchronous Integration Services Apex Quick Start Apex Basics & Database Apex Triggers Apex Testing Apex Coding for Admins

Slide 25

Slide 25 text

Check out these recent blog posts Salesforce developers blog (Emily Kapner): Keep Your Org in Tip-Top Shape with Deployment Best Practices Andy (Fawcett) in the cloud: Managing Dependency Injection within Salesforce Salesforce developers blog (Peter Chittum): Rethink Trigger Logic with Apex Switch

Slide 26

Slide 26 text

Q&A

Slide 27

Slide 27 text

No content