Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 3273

Re: Create Fiori Application with multiple entitysets

$
0
0

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));


Viewing all articles
Browse latest Browse all 3273

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>