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






Leave a Reply

Your email address will not be published. Required fields are marked *