cancel
Showing results for 
Search instead for 
Did you mean: 

SAP BTP Android SDK offline Create Media OData entity

0 Kudos

Hello Everyone,

When I try to create offline media entity getting below error though I unset "AttachmentDocumentUUID" while creating it.

Any suggestion here will be helpful. Thanks

viewModel.create(attachmentEntityCopy, media)
com.sap.cloud.mobile.odata.core.UndefinedException: Cannot get property 'AttachmentDocumentUUID' of type 'GuidValue' in entity type 'XXXXXXXx.Attachment', because the value is not set. This exception occurs because an undefined property is considered distinct from a null property (regardless of whether or not the property is defined as nullable in the service metadata). The attempt to access an undefined property may be evidence of a flaw in this client application (trying to access properties in a query result without having requested for the server to return values for the properties, or trying to access property values before initializing them), or may be evidence of a flaw in the service implementation (failing to return properties that were requested by the client application using $select or $expand). Depending on the root cause, options to avoid this exception include: (1) Getting the service implementer to fix the service if it is unexpectedly omitting expected property values in responses; (2) Initializing all properties in newly created objects before trying to access the properties (using the 'setDefaultValues' function, or by specifying 'true' for the 'withDefaults' parameter of the proxy class constructor); (3) Using the 'hasDataValue' function to check if properties are defined before trying to access them; (4) With the dynamic API, using the 'getOptionalValue' function instead of using the 'getDataValue' function
evanireland
Advisor
Advisor
0 Kudos

A stack trace would be helpful.

0 Kudos

Here is the stack trace of the crash

crash.txt

Accepted Solutions (0)

Answers (0)