Skip to Content

How to post to a custom url

Hello,

I am trying to create a simple application to approve or reject activities. For the purpose I created two function imports (Approve & Reject) in the Data Model of the oData service. I can access these imports successfully via the SAP Gateway Client and I think it all looks good on the server side.

However on my SAP UI5 Application, I am trying to send POST request to any of these services, but it doesn't work:

this.getModel().create("/Approve", oEntry, {

method: "POST",

success: function(data) {sap.ui.commons.MessageBox.alert("Success!");},

error: function() { sap.ui.commons.MessageBox.alert("Error!"); }

});

I see in the debugger that the post request is sent to /$batch instead of /Approve as I expected.

I guess I can use the standard REST Update function in order to accomplish the task, but I'd prefer to find a way to implement it this way.

So does anyone have an idea how can this be done?

Thanks,

Martin

capture.png (8.8 kB)
capture.png (6.3 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    Jun 21, 2017 at 12:12 AM
    Add comment
    10|10000 characters needed characters exceeded