Hello everyone, I'm Stephan Chandler-Garcia,
a Senior Developer Evangelist here at Salesforce.
Today we're going to cover Salesforce integration
best practices and see a demo of Salesforce platform
integration solutions in action.
Now, Salesforce really enables integration
across any business need.
Whether you're looking to unlock data
across your core systems of record,
standardize and transform data for complex processing,
or surface personalized views of data and information
directly inside of Salesforce.
Now, there are really six products
that make up our integration portfolio.
To kick it off is MuleSoft,
which is the world's leading integration platform,
and it really enables our customers to connect
any data source, app or device.
The other five products are known
as the Salesforce Platform Integration Solutions.
And they enable customers to connect data,
events and APIs to their Salesforce applications.
For the rest of this presentation,
we're going to really focus on those five products.
Now, those five products are Salesforce Connect,
which allows you to view search and modify data
that's stored on an external platform
within Salesforce.
Heroku Connect, which gives you a bi-directional
sync between Salesforce and Heroku Postgres,
platform events and change data capture,
which is our native pups up capability
for real time integration.
The many Salesforce APIs
for interacting with Salesforce data,
like the REST API and the SUP API,
and external services that give declarative builders
the power to call API from tools like (mumbles)
and process builder.
With these, Salesforce is able to offer our customers
the best solution for every integration Use Case.
You can use these products individually
or alongside each other,
depending on your integration needs.
In this demo, we're going to see how these five products
work in conjunction with each other
to provide a connected consumer experience,
and deliver a 360 view of your business.
We're going to use Salesforce Connect
to bring in some data from AWS,
first to use within the Salesforce UI.
Using platform events to send data to our Heroku app,
so that our customers can know our flash sale is ready.
We're going to use the composite API
as part of the REST API,
to deliver some data back to Salesforce.
We're going to use change date to capture,
to update the UI in real time.
And lastly, we're going to use external services in-flow,
to send a WhatsApp message via the Twilio API.
So, Pure Aloe is a fictitious agriculture
manufacturing and retail company.
This app has been downloaded from the Trailhead
sample gallery, for us to use as part of this demo.
Pure Aloe manages aloe harvest
and sales derived aloe products through distributor channel.
In this demo,
we're using the Salesforce platform integration solutions
to simplify complex process,
and integrate external systems within Salesforce.
So, here we are within the Pure Aloe app in Salesforce.
We're looking at a merchandise bundle of record
that is used to distribute flash sales to our customers.
On the right hand side,
we have our Pure Aloe Heroku app.
This is where customers will receive the flash sales,
place orders and view their order status.
Inside of our bundle, we have a merchandise list.
While this data looks like it's in Salesforce,
it's actually being brought over from a dynamo DB
instance on AWS.
We have used Salesforce Connect
to create an external object
that can be interacted with directly in our app.
So, let's go ahead and build our special
TDX 2020 bundle with a few products.
Let's go ahead and submit this order to our customers.
As you can see, the Heroku app
is automatically updated to contain the flash sale.
This was done using platform events.
We were able to subscribe to the message within the app
so that it updates immediately.
So let's take a look at how we fired that.
In Process Builder,
we can see that when the bundle is submitted,
we fire an action.
That action is a platform event.
This is received by the Heroku app
and it updates itself.
Back in the Heroku app,
a customer can place an order for the bundle.
When they click on submit,
the order's received directly by Salesforce.
If we take a look at the code behind the app,
we can see that we're using the composite API
to write back into Salesforce.
The composite API is perfect for this scenario,
because we need to train the relationships
between the records.
You can see here that we're referencing the parent objects
as the call out is made.
And this will allow us to create that data in Salesforce.
You might have also noticed that a path
was automatically updated.
This was completed using change data capture.
Here in set up,
you can see that the bundle has been selected for CDC.
This means that every time a change happens,
it publishes an event.
Now looking at our lightening web component,
we can see that the CDC event can be subscribed to
using the EMP API.
The EMP API allows you to subscribe to a channel
within platform events.
Now, in the connected callback,
we can initiate the subscription and process the event
when it's received,
allowing us to then update that path
and the data that you're seeing within the UI.
When the order is shipped,
the customer receives a WhatsApp message.
It looks like Sally will be receiving her order on Saturday.
This was done using an external service
that we called in a flow.
An external service allows us to expose a call out
to some of the declarative tools on platform.
Looking at our apex class,
we can see that we have defined an invocable method.
This is what enables the call out
in Process Builder and Flow.
Here we're using named credentials to call out
to the Twilio API to send our message.
This will allow us to ensure that the credentials
are stored within Salesforce
and not available in plain text inside of our Apex class.
And there you've now seen
how you can use Salesforce Connect
to utilize third party data within Salesforce.
We've used platform events to integrate with our Heroku app.
We've used the composite API
to create our orders in Salesforce,
and we've updated that merchandise bundle using CDC
and we've shipped and let the customer know
the status of their order using external services.
You can learn more about this by following along
with these Trailhead modules
covering all five services we've discussed today.
Thank you for attending this session,
hope you enjoy the rest of Trailhead DX.