on 11-25-2021 4:21 AM
hi,
I'm using below fun to post data to SAP, the data has been added successfully to SAP, but I'm unable to debug the response data from the Odata.
the messageToast for "Done" never reached.
From the odata side, I already filled the er_entity to display the inserted data, so it's not an empty response. I also tested it using sap gateway and the response has data.
But here I cannot read the response.
postData: function(oEvent) {
var oEntry = {};
oEntry.Firstname = this.byId("txtFirstname").getValue();
oEntry.Lastname = this.byId("txtLastname").getValue();
oEntry.Address = this.byId("txtAddress").getValue();
oEntry.Postal = this.byId("txtPostal").getValue();
this.getOwnerComponent().getModel("employee").
create("/employeesSet", oEntry, null, function(response) {
MessageToast.show("Done");
}, function(Error) {
MessageToast.show("Customer Creation Failed " );
});
},<br>
Please help
thanks
Hello Samuel,
Can you try like this ? Remove the 'null'.
Add the parameter "odata" and "response" or any name whatever you want in "success" function.
myModel.create('/employeeSet', oEntry, {
success : function(oData, oResponse) {
alert('Record Created Successfully...');
},
error : function(err, oResponse) {
}
});
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.