Best Practice and Security Question: Send Salesforce record Id to external Systems

apexbestpracticeintegrationrest-api

This may sound a silly question but i just wanna be sure i am following the best practices.

I have to integrate with some systems for Accounts, Cases, etc. Salesforce is the master system and after a record is inserted in Salesforce, it should also be inserted to some external systems. Then, in any updates in the external systems, Salesforce should get notified and perform also the same update.

  • Is it a best practice to send the Salesforce record Id and store it
    to the other systems as external Id? And then when other systems
    invoke Salesforce use the record Id to perform necessary updates?
  • Or is it better to generate an External ID and have this stored in
    the external systems ?

Best Answer

The External ID concept is primarily meant for use with systems that cannot use custom external identifiers of their own to reference Salesforce records, and also generate data that is bound for Salesforce.

If you can use a Salesforce ID in the external system, you can certainly use the Salesforce ID from the external system to update Salesforce records. Note that you can only have a limited number of External ID fields per object, so using Salesforce ID values is preferred when possible.

Related Topic