cancel
Showing results for 
Search instead for 
Did you mean: 

SAP MDK - Creating an attachment entry using createAttachmentEntry function.

0 Kudos
699

Hi Experts,

I’m building an app with pages built dynamically in Rules, and that is connected to an OData service with Offline functionality enabled.

I have a page with an attachment control that can contain images already loaded in from the OData service.

The entityset that contains the image is a Media Entity (has the HasStream="true" attribute). In a rule I’m able to read the the entityset, download the media, verify if its local but I cant build the createAttachmentEntry to feed into the Attachment control value.

I went through the example and the documentation on both the attachment and the createAttachmentEntry and I couldn’t get it to work.

Here is the metadata of the Entity of the attachment: <E

<EntityType Name="MyOrderDocument" m:HasStream="true" sap:content-version="1">
<Key>
<PropertyRef Name="DocumentId"/>
</Key>
<Property Name="DocumentId" Type="Edm.String" Nullable="false" MaxLength="40" sap:unicode="false" sap:label="Doc. ID" sap:creatable="false" sap:updatable="false" sap:sortable="false" sap:filterable="false"/>
<Property Name="OrderId" Type="Edm.String" Nullable="false" MaxLength="12" sap:unicode="false" sap:label="Order" sap:creatable="false" sap:updatable="false" sap:sortable="false" sap:filterable="false"/>
<Property Name="DocumentType" Type="Edm.String" Nullable="false" MaxLength="10" sap:unicode="false" sap:label="Document type" sap:creatable="false" sap:updatable="false" sap:sortable="false" sap:filterable="false"/>
<Property Name="FileName" Type="Edm.String" Nullable="false" MaxLength="255" sap:unicode="false" sap:label="Char255" sap:creatable="false" sap:updatable="false" sap:sortable="false" sap:filterable="false"/>
<Property Name="FileContent" Type="Edm.Binary" Nullable="false" sap:unicode="false" sap:label="File Content" sap:creatable="false" sap:updatable="false" sap:sortable="false" sap:filterable="false"/>
</EntityType>

Can someone explain how to load data into the attachment?

Thank you

Best Regards,

Nuno Oliveira

View Entire Topic
jorgeflorez
Explorer
0 Kudos

Hi nuno-oliv

How you solve this?

I have the same issue.