+ Start a Discussion
Ehsan DevEhsan Dev 

One-way Real-time (or near Real-time) Integration with external system

Senario 1: Accounts, Contact, Products, and a Custom Bbject records are created, updated, or deleted in Salesforce. Any of these changes need to be synced to an external system (that can recieve or send SOAP API messages) to keep the external system updated with the latest changes in Salesforce. These records will be read-only in the external system so this will be a one-way integration from Salesforce to the external system. Which of these option are the most effiecint way to avoid hitting the limits and efficient future maintenance:

1- Outbound Message action on a Workflow
2- Future Apex trigger on each object
3- Scheduled Apex Class to run in time intervals

Senario 2: Case and Order records (including Order Products) are created in Saleforce. Any new record should be sent to the external system. After the record created in the external system, any update will only be allowed in the external system and will be read-only in Salesforce. Therefore, any changes done in the external system should be synced back in a real-time or near real-time manner to Salesforce to show the most current status of the Order and Case in Salesforce. Which of the above the most efficient way fir this senario.

Any help is greatly appreciated.
Martijn SchwarzerMartijn Schwarzer
Hi Eshan,

For scenario 1 I would suggest you check out the Streaming API:

https://developer.salesforce.com/page/Getting_Started_with_the_Force.com_Streaming_API
https://developer.salesforce.com/docs/atlas.en-us.api_streaming.meta/api_streaming/

For scenario 2 I would suggest a combination of the already mentioned Streaming API and one of the following options:
  • Lightning Connect to read data from the external system realtime in SF
  • Update SF from the external system using either SOAP, REST or Bulk API

SOAP API: https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/
REST API: https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/
BULK API: https://developer.salesforce.com/docs/atlas.en-us.api_asynch.meta/api_asynch/

Lightning Connect: https://help.salesforce.com/HTViewHelpDoc?id=platform_connect_about.htm

Hope this helps!

Happy coding!

Best regards,
Martijn Schwärzer

Ehsan DevEhsan Dev
Thanks Martijm. I don't know much about the Streaming API.

-  Does the external system has to support this kind of API? This external system only supports SOAP API, as I mentioned in my question.
- The Streaming API documentation says it can send Push Notifications, but can this really be used to update, created, or delete records in the external system?

 
Ehsan DevEhsan Dev
By the way, Lightining Connect is not an option for this project.
Adrian  GawryszewskiAdrian Gawryszewski
In my opinion using Workflow is not the best solution. It is quite limited. I did similar project to yours where I had an external Web Service and was sending data form Salesforce to it. I used the a trigger because I new there will be a limited number of call per day made by my users so I new I want go over the limit. Scheduled APEX class would be desirable if you have a large number of those records to be sent every day then you can send over a collection every now and then. So I would say it is down to how much data you want to send over. I terms of time/effort both would be similar to implement. 
john yungkjohn yungk
I successfully used outbound messages in the past to sent new/updated obects to a backend system, but messages cannot be sent for objects that are deleted; this is the biggest constraint I see per your requirements. Also, with outbound messages there is no impact to the API call limit; there is however a limit on the number of outbound messages that can be sent from a workflow.

For scenario 2, you will need to send updated records back to Salesforce using one of the API's; REST, SOAP or Bulk. Rest will likely be easiest, but you will have to consider of updates made in a 24 hour period and the number on the SFDC API call limit.

I think if the requirenments didn't include standard objects, then Lightning Connect would have been an option, but that doesn't appear to be the case.
Nisha Pandey 26Nisha Pandey 26

Hi Ehsan Dev,

I have same requirement as you describe in senario 2. I hope till the date you have definatly find a great solution. it would be greatful if you can share the solution aprroach.

Thanks in Advance!!