cancel
Showing results for 
Search instead for 
Did you mean: 

oData V4 create entity

Former Member
6,676

Hi,

how do I create a new entity with oData V4 model without having an existing ListBinding?

I have a SimpleForm and want to create a new entity based upon the entered information.

So I tried to manually create a ListBinding as this seems to be the only way to create a new enitty via create() method.

var oListBinding = oModel.bindList("/Templates");
var oContext = oListBinding
    .create({"id":"1"});

But nothing is being sent to the backend.

What am I doing wrong?

All examples I have found base upon a control being bound and used a syntax like this

var oListBinding = this.getView().byId("mainmenulist").getBinding("items");
var oContext = oListBinding
    .create(oMainMenuItem);

Thanks

View Entire Topic
Former Member
0 Kudos

Hello Oliver,

could you explain to me how to create an entity with oData v4? If its possible without Listbinding, because i dont have a list. I use two input fields to create a new entity.
Thank you very much!

Former Member

Do you have this answer already? I have the similar issue if you can share your solution. Thanks

former_member374496
Participant
0 Kudos

Hi marc1412,

Did you get a solution on this?