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-