cancel
Showing results for 
Search instead for 
Did you mean: 

Property Invalid Error on model.create()

Former Member
0 Kudos

I'm using ES4 as my backend. I have a create method for creating Business Partners. I'm doing this via oModel.create(). But whenever I try to create a new entry, I'm getting an error.

I'm guessing it has something to do with the complex type of Address.

Here is my method

Accepted Solutions (0)

Answers (2)

Answers (2)

kammaje_cis
Active Contributor
0 Kudos

'Address' is a complex type. Complex types cannot be arrays. You are assigning an array to a complex type.

So below should work.

itemData = {

'City' : 'City1',

'PostalCode': 'PostalCode1',

.....

}

former_member340030
Contributor
0 Kudos

Hi Melanie,

Check the gateway logs for more details , might be you are not sending the correct address. SAP might be checking the validity of postal code with city and country ... or any other check related to address.

thanks

Viplove

Former Member
0 Kudos

Hi Viplove,

Tried it using a valid address (copied some from the existing data from the odata service) but still having an error. Also I can do create using .submitChanges(). This was how the template in SAP WEDIDE implemented the create method. I'm trying to recreate the same functionality but with .create(). I tried type : '/IWBEP/GWSAMPLE_BASIC.CT_Address' since this was the complex type of "Address" on the payload. Maybe I'm pushing the data on itemData incorrectly.