SAP Knowledge Base Article - Public

2537592 - Download Attachments Using OData Service

Symptom

You want to download the files attached to your documents (Opportunities, Service Requests, Leads, etc.) by making use of the delivered OData Service in your Cloud for Customer system, but the file is downloaded with a different name and with no file extension.

Environment

  • SAP Cloud for Customer.

Reproducing the Issue

  1. Access the URL for the desired OData collection you want to use, for this test we will use the ServiceRequestCollection object.
  2. After using the URL for the object, i.e.: https://myXXXXXX.crm.ondemand.com/sap/c4c/odata/v1/c4codataapi/ServiceRequestCollection('Object ID')? (Replace XXXXXX with your system number after "my").
  3. Expand the Attachment folder by adding $expand=ServiceRequestAttachment at the end of the URL.
  4. Use the link provided in the property <d:DocumentLink>.
  5. If you click and select "Save" the file downloaded will be saved with the name "$value".

Cause

The OData service for the attachments folder has a property <Name>, which can be used to save the files with the correct names.

Resolution

This is the standard system behavior.

There is no intention to change this at this point, and our suggestion is to raise it as a new requirement in our Ideas Place, available at https://influence.sap.com/SAPCloudforCustomer.

Keywords

download attachments, odata services , KBA , LOD-CRM-EMP , Employee , How To

Product

SAP Cloud for Customer add-ins all versions