Hi all,
I have a simple form with input fields. The values of these fields I want to post via odata service into my backend by clicking a button. It´s my first post function and I don´t know how to use "oDataModel.createEntry" function (is this the right one?). Can anybody help my?
Here is my code:
var oButton = new sap.m.Button({
text: "Post",
press: function(){
var postURL = "/sap/opu/odata/bao/sc_api_ldr_srv/";
var oDataModel = new sap.ui.model.odata.ODataModel(postURL, true);
var newData = {
"odata.type": "/BAO/SC_API_LDR_SRV.LDR",
"ProcessID": sap.ui.getCore().byId("ProcessID").getValue(),
"IBAN": sap.ui.getCore().byId("IBAN").getValue(),
"CustomerName": sap.ui.getCore().byId("CustomerName").getValue(),
"AccountHolderName": sap.ui.getCore().byId("AccountHolderName").getValue(),
"CustomerID": sap.ui.getCore().byId("CustomerID").getValue(),
"LoanContractID": sap.ui.getCore().byId("LoanContractID").getValue(),
"DisbursementCurrency": sap.ui.getCore().byId("DisbursementCurrency").getValue(),
"DisbursementValue": sap.ui.getCore().byId("DisbursementValue").getValue()
};
oDataModel.createEntry(...
}
});