Skip to Content
avatar image
Former Member

Offline Post issue for APK build on SDK SP13 or +

Dear Team,

We are working on offline application using Kapsel plugin. Application is for android platform.

We are using SMP 3.0 SP Level 10 Version=3.0.10.0

When we are building APK using latest SDK SP15 and HAT 1.29.1 we are getting below error during offline activity.

{"error":{"code":-10103,"message":{"lang":"en-US","value":"[-10103] The specified key for the new entity is a duplicate of an existing entity."}}}

Please refer attached screenshot also for error.

error1.png

We are getting above error when we are trying to post request in offline store and below function we are using

sap.OData.applyHttpClient();

oModel.create("MobCodeSet", postEntry, null, function() {

console.log("Success");

}, function(error) {

this.showError("Error at UnAssign record: " + error.message);

});

But same code working fine when we are deploying it using SDK SP12 and HAT 1.17.2.

Please Suggest where it going wrong.

Regards,

Ashish

error1.png (120.6 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Apr 27 at 08:12 AM

    Hi Ashish,

    For the error message "The specified key for the new entity is a duplicate of an existing entity", it means if you post a record where all the key properties were supplied non-NULL values and the key values duplicate another record, it will be rejected with that exception.

    You need to go ahead and make that change to your code.


    Best Regards,

    Kevin

    Add comment
    10|10000 characters needed characters exceeded

    • Hell o Experts,

      As per Kevin suggestion we did changes in code. Now we are updating existing record using code

      sap.OData.applyHttpClient();

      oModel.update("MobCodeSet(OrderNo='5183819')", postEntry, null,

      function(){

      console.log(success);

      }, function(error) {

      console.log(error);

      }, true);


      But we are getting below Error:-

      "error":{"code":-10128,"message":{"lang":"en-US","value":"[-10128] The request on an entity failed because its etag did not match the request's conditions.

      Please suggest if there is anything missing.

      Regards,

      Ashish

  • avatar image
    Former Member
    Apr 27 at 08:24 AM

    Hi Kevin,

    Thanks for your Quick response.

    But same code is working fine when we are packaging and building APK using SDK SP12.

    But not working for higher SDK version. Is there any changes required in code for Latest SDK.

    Regards,

    Ashish

    Add comment
    10|10000 characters needed characters exceeded