Skip to Content
0

[SOLVED] SAP UI5 - oData - method READ - must be absolute if no Context is set

Apr 23 at 02:29 PM

235

avatar image
Former Member

Hi,

I have the following problem:

I have a model that exists in the project, but I want to read a specific content inside a forEach, but it displays the error message:

2018-04-23 11:26:01.927100 EventProvider sap.ui.model.odata.v2.ODataModel path Usuario_Tabela('S_ADMIN.USUARIO')/Usuario_Tabela_Permissao must be absolute if no Context is set -

follow the code

var oModelAdmin = this.getOwnerComponent().getModel("admin");
oModelAdmin.read("Usuario_Tabela('S_ADMIN.USUARIO')/Usuario_Tabela_Permissao", {
    method: "GET",
    success: function(data) {
        var oData = data.results;
        console.log(oData);
        oData.forEach(function(element, index){
        });
    },
    error: function(error) {
        MessageToast.show(error);
    }
});


10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Best Answer
avatar image
Former Member Apr 23 at 02:39 PM
0

RESOLVED

missing bar "/" at start of request

OLD
oModelAdmin.read("Usuario_Tabela('S_ADMIN.USUARIO')/Usuario_Tabela_Permissao", {
NEW
oModelAdmin.read("/Usuario_Tabela('S_ADMIN.USUARIO')/Usuario_Tabela_Permissao", {

Share
10 |10000 characters needed characters left characters exceeded