Skip to Content
avatar image
Former Member

Binding new entities to existing entities via NavigationProperty is not supported

Hi all,

I am trying to insert multiple records using nested json request body but when I am inserting it using POSTMAN I am getting following error

Binding new entities to existing entities via NavigationProperty is not supported

Following are the artifacts that I am using to do so :

service url : http://server:port/logic/odata/person.xsodata/PersonBean   POST

request body :

{

    "PERS_ID": 30,

    "FIRSTNAME": "TstFNameClient",

    "LASTNAME": "TstLNameClient",

    "E_MAIL": "TstemailClient@gmail.com",

    "AddressBean": [

        {

            "ADDRESS_ID": 12,

            "ADDRESS_TEXT1": "tstadd1client",

            "ADDRESS_TEXT2": "tstadd2client",

            "CITY": "tstcityclient",

            "STATE": "tststateclient",

            "COUNTRY": "tstcountryclient",

            "ZIP": "12345",

            "PERS_ID": 30

        }

    ]

}

OData Service code :

service namespace "cust.quote.service" {

  "ZCUSTSEARCH"."TBL_PERSON"

   as "PersonBean"

   navigates ("Address" as "AddressBean");

  "ZCUSTSEARCH"."TBL_ADDRESS"

  as "AddressBean";

  association "Address" principal "PersonBean"("PERS_ID")

  multiplicity "1" dependent "AddressBean"("PERS_ID") multiplicity "*";

}

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • avatar image
    Former Member
    Dec 03, 2015 at 02:24 PM

    Hi,

    I am trying to do something similar using a many-to-many association and have run into the same error.  Did you ever find an answer or alternative technique?  I see that this question is over a year old and not answered.

    Here is my oData service definition:

    service {

      "yyy.zzz.ComplianceTracker.data::ComplianceModel.Resource"

          as "Resources"

          navigates ("ToResourceComplianceRequirements" as "ResourceComplianceRequirements")

          create events(before "yyy.zzz.ComplianceTracker.services:resourceComplianceRequirements.xsjslib::createResourceBeforeExit")

          ;

      "yyy.zzz.ComplianceTracker.data::ComplianceModel.ComplianceRequirement" as "ComplianceRequirements";

      association "ToResourceComplianceRequirements"

      principal "Resources"("ID") multiplicity "*"

      dependent "ComplianceRequirements"("ID") multiplicity "*"

      over "yyy.zzz.ComplianceTracker.data::ComplianceModel.ResourceComplianceRequirement"

      principal ("RESOURCE.ID")

      dependent ("COMPLIANCE_REQUIREMENT.ID");

    }

    Here is my request payload:

    {

      "ID": "0",

      "NAME": "",

      "DESCRIPTION": "",

      "ResourceComplianceRequirements": [{"ID": "1"}]

    }

    Here is response body:

    {

       "error": {

       "code": "",

       "message": {

       "lang": "en-US",

       "value": "Error processing request stream. Binding new entities to existing entities via NavigationProperty is not supported. NavigationProperty: ResourceComplianceRequirements"

       }

       }

    }

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Feb 16, 2016 at 06:12 PM

    Hello everybody,

    are there any news/ideas regarding this one? I recently started working with the hana cloud platform and xsodata services. I am currently at a point where I have a similar entity releationship as stated by dharmesh and similar requirements: I want to insert a record of a type which contains a nested type.

    unfortunately, I encounter the same error mentioned in the above posting:

    {

      "error": {

        "code": "",

        "message": {

          "lang": "en-US",

          "value": "Error processing request stream. Binding new entities to existing entities via NavigationProperty is not supported. NavigationProperty: foobarB"

        }

      }

    }

    does anybody have an advice on how to solve this? 😉

    thanks in advance,

    Jan

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hey Neal,

      thanks for the reply, that was helpful.

      although i was hoping that providing "deep" entities as an input to an odata create service is possible (event if that would force me to create a custom create EXIT).

      Inserting deep entities is possible when using odata services which are exposed by netweaver gateway systems. So why does this not apply to an XSOdata service?

      thank you and best regards,

      jan