Skip to Content
0
Oct 07, 2019 at 12:26 PM

Specified key for the new entity is a duplicate of an existing entity(Cloud Platform SDK for Android

346 Views

Hi Team,

When we saving data to offline database it showing error "[-10103] The specified key for the new entity is a duplicate of an existing entity".

Note : Here data is saved in offline database and update to server. I am doing $batch request approach. I seen above error while doing debug mode .

I am doing single batch and single change set while doing processBatch();

Any thing missed let me know.

Sample Metadata :

<EntityType Name="CRMGenericStagingService" sap:content-version="1"> <Key> <PropertyRef Name="ServiceObject"/> <PropertyRef Name="DeviceId"/> <PropertyRef Name="RecordId"/> <PropertyRef Name="FieldName"/> </Key> <Property Name="ServiceObject" Type="Edm.String" Nullable="false" MaxLength="40" sap:label="Server Object" sap:creatable="false" sap:updatable="false" sap:sortable="false" sap:filterable="false"/> <Property Name="DeviceId" Type="Edm.String" Nullable="false" MaxLength="40" sap:label="Device ID" sap:creatable="false" sap:updatable="false" sap:sortable="false" sap:filterable="false"/> <Property Name="RecordId" Type="Edm.String" Nullable="false" MaxLength="15" sap:label="Record Id" sap:creatable="false" sap:updatable="false" sap:sortable="false" sap:filterable="false"/> <Property Name="FieldName" Type="Edm.String" Nullable="false" MaxLength="40" sap:label="Help ValueFieldName" sap:creatable="false" sap:updatable="false" sap:sortable="false" sap:filterable="false"/> <Property Name="FieldValue" Type="Edm.String" Nullable="false" sap:label="Field_value" sap:creatable="false" sap:updatable="false" sap:sortable="false" sap:filterable="false"/> </EntityType>

We are following below link:

https://help.sap.com/doc/c2d571df73104f72b9f1b73e06c5609a/Latest/en-US/docs/user-guide/odata/Offline_OData_Modifying_Offline_Data.html

Regards

Ramakrishna. Amathi