cancel
Showing results for 
Search instead for 
Did you mean: 

Problems when posting a new Entity from UI5 to XSOData Service

Former Member
0 Kudos

Hi,

I am trying to add a new Entity by posting it from ui5 to the corresponding xsodata service in hana cloud. Sadly I get the error "Request contains properties that do not exist in entity" as shown in the screenshot.

The Entity City is defined as follows:

Entity City{

       key CITYID: Integer;

       NAME: Types.StdString;

       ZIPCODE: Integer;

       STATEABBREVIATION: Types.StdString;

       COUNTRY: Association to Country;

};

The Type City is defined as follows:

type City {

            CITYID: Integer;

            NAME: Types.StdString;

            ZIPCODE: Integer;

            STATEABBREVIATION: Types.StdString;

            COUNTRY: Integer;

};

I tried to add it like i did before with another Entity, where I didn't get any errors. The only difference is the association.Can you Help me? Do you need further informations?

Best regards,

Juergen

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

Hi Juergen,

how does your payload look like?

Looks like you're using Google Chrome, so to find out open the devtools before sending the request. Then send the request and select it in the "Network" tab of the devtools. There you can find the request payload. Please check it for any mismatches. If you need further help provide the payload here.

Regards,

Philipp

Former Member
0 Kudos

Hi Philipp,

thanks for your reply. I checked the payload but the only difference I can detect is that the table collumn for the country is displayed as "COUNTRY.COUNTRYID" whereas the entity in cds, the type for the procedure as well as the payload show "COUNTRY". Could this be the cause for my problems?

Payload:

Type:

Entity:

Table:

Regards

Juergen

0 Kudos

Can you provide the metadata of your service?

Should be available here: https://taoa9ff98611.int.hana.ondemand.com/tao/api/services/City.xsodata/$metadata

There are all the fields listed, that the service expects.

Former Member
0 Kudos

Thanks for the Tip. This is the metadata of the service:

I changed the json object, which is sent to the service to match the property name "COUNTRY.COUNTRYID". Now the question remains how to change the cds type "City" as well as the precedure to match this property as "." aren't possible. Otherwise I get the following error as expected:

Can you tell me how to change the cds type and accordingly the procedure?

Former Member
0 Kudos

Hi Phillip,

I changed the input of the procedure from the city type to the city entity intself. Now it works perfectly.

Thank you for your help.

Best regards

Juergen

Answers (0)