Hey Suraj,
You could do something similiar to invoke create deep entity method
var oModel = this.getView().getModel();
var oData = this.getView().getModel("create").getData(this._sPath).Order;
this.getModel("appView").setProperty("/busy", true);
// add as many items you want
var aQuoteItems= [];
aQuoteItems.push({
"HeaderGuid": oData.Guid,
"ItemId": oData.ItemId,
"Quantity" : oData.Quantity
});
var mPayload = {
"d":
{
"HeaderGuid" : oData.Guid,
"QuoteId" : oData.QuoteId,
"Partner" : oData.Partner,
"QuoteItemsSet" : aQuoteItems
}
};
console.log("mPayload", mPayload);
// create deep entity
oModel.create("/QuoteHeader ", mPayload, null, jQuery.proxy(function(oData, oResponse){
this.getModel("appView").setProperty("/busy", false);
sap.m.MessageToast.show("Success!");
},this),
jQuery.proxy(function(oError){
sap.m.MessageBox.show(
"Error",
sap.m.MessageBox.Icon.ERROR,
"Hata!"
);
this.getModel("appView").setProperty("/busy", false);
},this));