Heroku postgres Integration with Force.com

Login to www.heroku.com

Go to heroku Dashboard

Click ‘New’ to create Application

Create App

Enter App name: sfdc-heroku-integration

click ‘Create app’ button to continue


Click on App icon and select Elements

Select Heroku Postgres on the Heroku Elements page



Click on ‘Install Heroku Postgres’ and continue



Select your app name to install Postgres



select the free version and click on Provision button



You will landup on the below page after successfully installing Postgres on the Heroku platform



Installing Heroku Connect

Heroku connect  helps you to synchronize data to Salesforce



Select app name to install Heroku Connect, in our case app name is sfdc-heroku-integration



Click on Provision button to continue


After successful installation, you will be landed on to the below page


Configuring Heroku Connect to Sync data from Salesforce


Click on Heroku Connect from Dashboard->App->Resources section


Click ‘Setup Connection’


Enter schema name and click Next


Click ‘Authorize’ and continue


Select your Salesforce org to install, After successful installatoin, you will see below screen



Synchronize Salesforce object data into Heroku Postgres


Click ‘Create Mapping’


select Objects you want to synchronize


Select Object Fields you want to Synchronize, you can also set Poll Frequency ( minimum poll frequency set at 10 minutes )




After you complete the setup you will see below screen. We can clearly see number of fields, number of records that are inserted into Postgres DB

Salesforce to Salesforce Integration using REST Webservice

Use Case:

An organization has two salesforce org ( Sales Org and R&D Org ). Sales Org user wants to create a support request in R&D org for a Sales Org opportunity. R&D org team has special skills to work on those Support Requests. Sales Org user is willing to share some of the opportunity field data and restrict sharing access to only for the opportunities that have Support Requests. Sales Org User is also interested to know the status and owner of the Support Request. R&D Org users should be able to run reports on Case/Support Request/Opportunity(Sales Org) data


Providing a button on Opportunity UI to create a support request. Invoking a Visualforce page and using a controller class system can call Webservice on R&D Org to create a Case. Whenever a Support Request is created checkbox is updated in opportunity object, based on the checkbox opportunity information is shared with an integration user. Salesforce lightning connect is used to integrate Sales Org & R-&-D org. Check out my blog post on lightning connect. R&D Org can call webservice on Sales Org to update Support Request Owner and Status details in Sales Org system.



Below flow gives a top view of how the integration/data flow between the systems.


Step #1: Authentication

Sales Org calls Webservice on R&D Org

R&D Org authenticates Sales Org call

R&D lets Sales Org create Case after authentication

Salesforce configuration details:

Configure Connected App in R&D Org

Configure Authentical Provider in Sales Org

Configure Named Credentials in Sales Org

Use Named Credentials in Webservice Callout script

Follow blog post ‘How to configure Named Credentials


Step #2: Creating Webservice on R&D Org



Step #3: Controller class to create call R&D Webservice from Sales Org



Step #4: VF Page to create Support Request



Step #5 : Create Support Request button configuration on Opportunity Page

go to Setup->Opportunity->Buttons to create Button



Step : #6: Add button to Layout






Salesforce to Salesforce Integration using Lightning Connect

Salesforce Connect cross-org adapter helps you to integrate two Salesforce org.  Data will be replicated into target org from source org using Salesforce connect cross-org adapter. The objects that show in target Salesforce are visible under external objects. However we have few limitations, you may not be able to configure workflows or can write a trigger on these objects.

Benefits of Salesforce Connect

  • You have a large amount of data that you don’t want to copy into your Salesforce org.
  • You need small amounts of data at any one time.
  • You want real-time access to the latest data.


Use Case:

Source Org users create a simple support request in Target Salesforce org as Target org users have the expertise to resolve the issue. However source org users doesn’t want to share all the Opportunity, Account, Product Data. They only want to provide a limited information needed by Target Users to resolve a support request. Any solution using Webservice integration involves more coding and synching the data of Account, Opportunity and Product can lead to additional complexities.


  • Create an Integration Profile and an Integration User in source Salesforce org setting necessary Object and field level permissions to expose required Objects and fields to the target Salesforce org users. You can also control data exposure to target Salesforce org users based on the data security requirements.
  • Configure External Data Sources to use Salesforce Connect ( Cross-org adapter ) to retrieve source Salesforce org objects in target Salesforce org as External objects. ( Note: Salesforce Connect also helps you to connect to other applications where data/metadata is exposed using OData 4.0/OData 2.0 specifications.
  • Configure Layouts, Build reports ( limited functionality ), on these exposed external objects in the target Salesforce Org


Go to Setup-> Type in “External” in Quick Find Box and select External Data Sources

Click on “New External Data Source” button


In case if you don’t see the option Salesforce Connect cross org picklist value then you have to  Install Lightning Connect



Identify Type can be set to either Per User or Named Principal. Here we are going with an approach of using an integration user.

Authentication Protocol can be set as Password Authentication or you can OAuth Integration if you want to embed more security features. In this use case, we are going with basic authentication using “Password Authentication” approach

Enter Integration User Name and Password (password+Security token as needed) and click Save

In next step click on Validate and Synch button to retrieve source Salesforce objects

Select necessary objects you want to Sync and click on Sync button


Go to Setup->enter external in quick find ->click on External Objects


In next step, you can see the external objects that are synching from source system


Configure Tabs and Page layouts

You can follow Salesforce configurations to create Tabs and Page Layouts like the custom objects.


More Reading:




Salesforce Backup and Restore Essentials Part 1 – developer.force.com

Salesforce Backup and Restore Essentials Part 1 – developer.force.com


powered by Sign Up › Login › My Developer Account > Create Account > My Settings > Log out powered by Login Logout Products Platform App Cloud AppExchange Force.com Heroku Mobile Salesforce Apps Analytics Cloud Community Cloud Marketing Cloud Pardot Quip Build Faster, Smarter & Together Lightning Einstein Salesforce DX Resources Learn Getting Started Documentation Trailhead Books & Cheat Sheets On-Demand Webinars Certification Blogs Tools Force.com IDE Force.com CLI Lightning Design System Sour…

The difference between RTO and RPO


The difference between RTO and RPO By Editor | Published: July 17, 2014 There is a good chance that you would like to see your business survive any future disaster, and any problems that follow as well. While it is nearly impossible to predict what the next disaster will be, it’s easy to prepare for, especially if you have an effective business continuity plan. When it comes to these plans, there are many key metrics you need to be aware of and the most important two are RTO and RPO. While both…