function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Kiru535Kiru535 

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.

Sonam_SFDCSonam_SFDC
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
Kiru535Kiru535
I need to do validations before create an opportunity in destination org. so that is why i needed code