In salesforce, an outbound message is a specific type of action that transmits data in the form of XML to an external service endpoint (Extensible Markup Language). It used to transmit object field data to your third-party application so it may carry out the required task.
A common use case is to create/update Order records in backend systems like Order Management System , whenever a new Order gets created or an existing Order gets updated in Salesforce.
Image from the Salesforce SOAP API Developer Guide illustrating the Outbound Message flow:
Four Salesforce capabilities that let us perform automations on record creation/updation are:
- Process Builder
- Workflow Rules
- Salesforce Flow
- Apex Trigger
Workflow Rules, Process Builder, and Salesforce Flow are among the first three features that fall under Salesforce's declarative functionality, whereas Apex Trigger needs authoring code.
We can send an Outbound Message using Workflow Rules or by using Salesforce Flow. But the best option is to adopt Salesforce Flow because Salesforce has previously said that Workflow Rules & Process Builder would be deprecated by 2023.
This blog will show you how to send outbound messages from the Flow.
Before moving in to Salesforce to send an Outbound Message, first we need an endpoint URL. So, for the endpoint URL, we will use a service called that is provided by PipeDream at https://pipedream.com. PipeDream enables us to create public endpoints for receiving and inspecting HTTP requests from any source, as well as easily inspecting the headers, payload, and more.
Steps to create an endpoint URL in Pipe Dream:
3. After clicking the "New Button". Select source as HTTP/WebHook
5. Give the Name for your Service and Click the button "Create Source".
Response body
The body to return in the HTTP response with the following code given below:-<?xml version="1.0" encoding="utf-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:out="https://soap.sforce.com/2005/09/outbound">
<soapenv:Header/>
<soapenv:Body>
<out:notificationsResponse>
<out:Ack>true</out:Ack>
</out:notificationsResponse>
</soapenv:Body>
</soapenv:Envelope>
Steps to create an outbound message in salesforce:
- Navigate to Setup.
- In the Quick Search Box, type Remote Site Settings.
- In Remote Site Settings, select New Remote Site.
- Fill in the Remote Site Name field with Your Own Name.
- Paste the URL from Pipe Dream into the Remote Site URL field.
- Disable Protocol Security should be checked. Otherwise, leave it unchecked because it is an optional option.
- Provide a description (Optional).
- Check that the Active Checkbox is selected.
- Check that the Active Checkbox is selected.
- Click Save.
- Navigate to Setup again and in the Quick Search Box, type Outbound Message.
- In Outbound Message Settings, select New Outbound Message .
- Select Object as "Opportunity" and click Next
We have done all the steps that were required. now is show time:-
Our Service is waiting for response from Salesforce:-
Very useful
ReplyDelete