Org2Org File Transfer in salesforce (code written in destination org)
Last Updated: 09-11-2023 Let's define the terms we will use in this blog post: Source org - The org that has all the files. Current org (destination) - The destination org where all files are to be fetched from the source org. Because all code will be written in the destination org only; no coding will be done in the source org. To upload files from one Salesforce org to another using Salesforce REST APIs, you can follow these general steps: Get Session Token , Org Base URL of source org. Get Record Ids from which we need to get the related files. Hit the Salesforce REST APIs to fetch the files from source org. Create Content Version in current org (destination). Create Content Document Link in current org (destination) which will associate the file with the record you want. Before going to code let's make our current org ready, we will create 2 fields in our object level Ext_Record_Id__c - The record id of the record in the source org that we need to retrieve the fi