+ Start a Discussion

Create new opportunity in other SFDC instance by using Rest API

I am new to Rest API. I have a requirement like this

2 instances -- S1, S2

Create one button in S1 instance - Opportunity detail page called Pust To S2. When user clicks on this button first validate the opportunity number field exist or not. If exist do not push this opportunity to S2 instance, Else by using rest API we have to create same opportunity in S2 instance and return created opportunity id to S1 Instance.

Please post me a code for this.

Hi Kiru,

This is surely possible through code(rest API : https://www.salesforce.com/us/developer/docs/api_rest/), however, i would like to suggest you the option to establish Salesforce to Salesforce connection between ORG 1 and 2.

Salesforce to Salesforce is a feature that helps you share records between two orgs with a click of a button - so you would be saved from created code: read more: http://wiki.developerforce.com/page/An_Introduction_to_Salesforce_to_Salesforce
I need to do validations before create an opportunity in destination org. so that is why i needed code