Skip to Content
avatar image
Former Member

Property Invalid Error on model.create()

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Jan 17, 2017 at 07:52 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      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.

  • Jan 18, 2017 at 04:02 AM

    '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',

    .....

    }

    Add comment
    10|10000 characters needed characters exceeded