Punta Dreaming by Luciano Straga #pd17 - Punta del Este, Uruguay

23
@puntadreamin #PD17

Transcript of Punta Dreaming by Luciano Straga #pd17 - Punta del Este, Uruguay

Page 1: Punta Dreaming by Luciano Straga #pd17 - Punta del Este, Uruguay

@puntadreamin #PD17

Page 2: Punta Dreaming by Luciano Straga #pd17 - Punta del Este, Uruguay

Luciano StragaSalesforce Certified ProfessionalDreamforce 16 & 15 Speaker

@stragaluciano

Salesforce Connect Custom Apex AdaptersToday, Heroku Redis within Salesforce

Page 3: Punta Dreaming by Luciano Straga #pd17 - Punta del Este, Uruguay

Session Agenda

Topic Presentation - Scenario Explained

Heroku Redis – Redis Databases Capabilities - Demo

Salesforce Connect – External Sources – External Objects

Apex Connector Framework - Demo

New Objects Relationships for External Objects - Demo

Resources

Q&A

1

2

3

4

5

6

7

Page 4: Punta Dreaming by Luciano Straga #pd17 - Punta del Este, Uruguay

Topic PresentationScenario Explained

Page 5: Punta Dreaming by Luciano Straga #pd17 - Punta del Este, Uruguay

Punta AirlinesA small airline with growing sales

Basic Requirements – > Sell Tickets

• Visualize and manage current flights and bookings in SF

• Purchases may occur both in SF and Website

• Flights and Bookings data is outside Salesforce

• Two way integration between Salesforce and Website on real time

Page 6: Punta Dreaming by Luciano Straga #pd17 - Punta del Este, Uruguay

Node Web App - Redis DB

External REST API

Salesforce Connect

Salesforce Org

Text Text Text Text

Use Case ScenarioElements Involved

Page 7: Punta Dreaming by Luciano Straga #pd17 - Punta del Este, Uruguay

Heroku RedisDatabase Capabilities - Demo

Page 8: Punta Dreaming by Luciano Straga #pd17 - Punta del Este, Uruguay

Heroku RedisRedis Databases In-memory key-value data storage - NoSQL

Data stored in RAM memory Flexible Data Types

String Hashes Lists -Sets - Sorted Sets Bitmaps – Hyperloglogs – Geospatial Indexes

Common uses: Database Cache (Non long term storage) Message Broker - Broadcasting

Page 9: Punta Dreaming by Luciano Straga #pd17 - Punta del Este, Uruguay

Salesforce ConnectKey Features – External Objects – External Sources

Page 10: Punta Dreaming by Luciano Straga #pd17 - Punta del Este, Uruguay

Salesforce ConnectFramework

Seamless integration of external data CRUD of data stored outside your Salesforce Org.

NO DATA REPLICATION/ Redundancy Real time data access over external objects. Always up to date.

Native Adapters – Point & Click Integration Protocol-specific adapters: Odata 2.0 / 4.0 Cross-org (Between Salesforce orgs) Custom Apex Adapters

Page 11: Punta Dreaming by Luciano Straga #pd17 - Punta del Este, Uruguay

Salesforce ConnectUsed when:

Large amount of data that should not be stored in Salesforce

Small amounts of data at any one time.

Real time access is crucial to get latest data.

Page 12: Punta Dreaming by Luciano Straga #pd17 - Punta del Este, Uruguay

Salesforce External ObjectsKey Concepts and Features

Similar to custom objects.

__x extension. Mapped to external

data tables in external systems.

New object relationships:

External lookups. Indirect lookups.

Page 13: Punta Dreaming by Luciano Straga #pd17 - Punta del Este, Uruguay

External Objects vs. Custom Objects

Features Custom Objects External Objects

Data stored in Salesforce org Yes NO

CRUD Yes YES*

Tabs / Layouts / Field Level Security Yes YES*

REST - SOAP API / SOQL – SOSL / Apex / Visualforce Yes YES*

Formulas / Workflow / Triggers / Reports Yes YES

Chatter Yes Yes*

Top Differences

Page 14: Punta Dreaming by Luciano Straga #pd17 - Punta del Este, Uruguay

Apex Connector FrameworkKey Concepts & Capabilities - Demo

Page 15: Punta Dreaming by Luciano Straga #pd17 - Punta del Este, Uruguay

Apex Connector FrameworkKey Concepts & Capabilities Set of classes and methods for creating external data sources. DataSource namespace.

When OData & Cross Salesforce Org adapters are not suitable for the use case.

Based on REST – SOAP callouts. Own custom adapter implementation. Two Apex Classes need be extended for creating external data

sources: DataSource.Connection class. DataSource.Provider class.

Page 16: Punta Dreaming by Luciano Straga #pd17 - Punta del Este, Uruguay

Apex Connector FrameworkDataSource.Connection class Obtain external system schema

and CRUD operations. Methods to override: sync(). query(). search(). upsertRows(). deleteRows().

Authentication capabilities. Functional capabilities. Methods to override: getAuthenticationCapabiliti

es (). getCapabilities(). getConnection().

DataSource.Provider class

Page 17: Punta Dreaming by Luciano Straga #pd17 - Punta del Este, Uruguay

Apex Connector FrameworkExternal IDs for Salesforce Connect External Objects

External object has the External ID standard field for unique identification.

The custom adapter’s code must declare the DataSource.Column named ExternalID.

Salesforce storages this value.

Page 18: Punta Dreaming by Luciano Straga #pd17 - Punta del Este, Uruguay

Apex Connector FrameworkSupport for Writable External Objects

Creating,updating and deleting external records are not perfect processes.

Insert(), update() and create() operations are not allowed for external objects.

Database.insertAsync(). Returns a SaveResult object with an identifier for the insert job.

Page 19: Punta Dreaming by Luciano Straga #pd17 - Punta del Este, Uruguay

Apex Connector FrameworkAuthentication for Salesforce Connect Custom Adapters DataSource.Provider class declares authentication type: Anonymous -> Support for Name Credentials Basic Certificate OAuth

DataSource.ConnectionParams depends on the Identity Type defined in Salesforce.

Name Principal –> From external data source definition. Per User –> From current user that invokes the query or search.

Page 20: Punta Dreaming by Luciano Straga #pd17 - Punta del Este, Uruguay

New Object Relationships for External ObjectsExternal & Indirect Lookup Relationships - Demo

Page 21: Punta Dreaming by Luciano Straga #pd17 - Punta del Este, Uruguay

New Object Relationships for External Objects External Lookup Relationships Indirect Lookup

Relationships

External Object

(Parent)

Standard - Custom - External(Childs)

Standard - Custom(Parent)

External

(Childs)

Page 22: Punta Dreaming by Luciano Straga #pd17 - Punta del Este, Uruguay

Session ResourcesBlaze your own trail!

https://punta-airlines.herokuapp.com/

https://github.com/lucianostraga/puntadreaming

https://trailhead.salesforce.com/module/lightning_connect

@stragaLuciano

https://ar.linkedin.com/in/luciano-straga-121a9167

Page 23: Punta Dreaming by Luciano Straga #pd17 - Punta del Este, Uruguay

Q&A