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

Preview:

Citation preview

@puntadreamin #PD17

Luciano StragaSalesforce Certified ProfessionalDreamforce 16 & 15 Speaker

@stragaluciano

Salesforce Connect Custom Apex AdaptersToday, Heroku Redis within Salesforce

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

Topic PresentationScenario Explained

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

Node Web App - Redis DB

External REST API

Salesforce Connect

Salesforce Org

Text Text Text Text

Use Case ScenarioElements Involved

Heroku RedisDatabase Capabilities - Demo

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

Salesforce ConnectKey Features – External Objects – External Sources

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

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.

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.

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

Apex Connector FrameworkKey Concepts & Capabilities - Demo

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.

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

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.

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.

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.

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

New Object Relationships for External Objects External Lookup Relationships Indirect Lookup

Relationships

External Object

(Parent)

Standard - Custom - External(Childs)

Standard - Custom(Parent)

External

(Childs)

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

Q&A