How to Retrieve Attachment from Salesforce.com using Oracle Cloud Adapter for Salesforce.com

I get this question from various forum on how to retrieve attachment from Salesforce.com using Oracle Cloud Adapter for Salesforce.com. There are various use cases where people may want to get attachment and sync it with other applications.

One of the use case where user wants to sync cases from Salesforce.com as incident to Oracle Service Cloud. and user wants to sync attachment and comments / solutions to Oracle service cloud. Let’s take this example and see how this can be achieved.

In above use case, you would like to receive case message from Salesforce.com as and when your condition is met and you want to sync with Oracle Service Cloud. (How to Receive Case Messages from Salesforce.com)

Now once you get receive message related to case object, you would like to get the attachment associated to this case object. To do that you can configure Salesforce adapter with query operation with following query –

select status, subject, (select id, name from attachments) from Case where id=’&caseid’

above query will give id of attachment and then you can fetch the body of the attachment object of salesforce.com by configuring salesforce adapter again with below query operation –

select body, name from Attachment where id=’&attachmentid’

then finally pass body element to target (Oracle Service Cloud) via mapper.

So overall integration will look something like below-

Flow_attachment

4 thoughts on “How to Retrieve Attachment from Salesforce.com using Oracle Cloud Adapter for Salesforce.com

  1. Hi Shalidra, I’m developing a use case in which we need to get file from Salesforce and upload the same into sharepoint. I got the salesforce adapter in place and got the file body using select body, name from Attachment query. Now i m using the Sharpoint rest service to upload the same file into sharepoint repository. Can you please let me know how to map the body element as a binary in ICS mapper using REST adapter as i’m using sharepoint rest services.

    1. Hi Ankur,
      You first need to find out if sharepoint Rest API supports binaries data for attachment or MTOM attachment. if REST API supports base64 encoded data that it will be straight 1 to 1 mapping from body element to next element at sharepoint side. but they support MTOM, then you first need to write that file (file stage activity) and decode it and then assign that file as an attachment.

  2. Hi, I have one question and I want to get file from oracle fusion and attach it to salesforce record. How we can do that? Can you please let me know.

    1. Hi Anis,
      Oracle Fusion adapter support REST API and I hope, you know the way to extract the attachment from Oracle Fusion. If Oracle Fusion ERP supports attachment as base64 encoded then you can directly pass it to Salesforce.com but if they support some other wat like MTOM then you need to download attachment into OIC and then make use of file stage activity or file adapter to encode the file before assigning it to Salesforce.com.

      Shalindra

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s