Skip to Content
0
Former Member
Jan 13, 2015 at 06:16 AM

Query options $orderby, $inlinecount, $skip and $top cannot be applied to the requested resource

1943 Views

Hi Experts


I run the code I paste at the end of the Discussion with no problem, but if I want to display only one result

Instead of path: "/Orders",

I want to use path: "/Orders(10251)",

This error appears

Query options $orderby, $inlinecount, $skip and $top cannot be applied to the requested resource


If I run the call on the browser, and there is no problem.


http://services.odata.org/Northwind/Northwind.svc/Orders(10251)?$expand=Customer

Is there any work around to display only one result also using the $expand

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

<!DOCTYPE HTML>

<html>

<head>

<meta http-equiv="X-UA-Compatible" content="IE=edge">

<meta http-equiv='Content-Type' content='text/html;charset=UTF-8'/>

<script src="https://sapui5.hana.ondemand.com/resources/sap-ui-core.js"

id="sap-ui-bootstrap"

data-sap-ui-libs="sap.m,sap.ui.table"

data-sap-ui-theme="sap_bluecrystal">

</script>

<!-- only load the mobile lib "sap.m" and the "sap_bluecrystal" theme -->

<script>

var url = "proxy/http/services.odata.org/Northwind/Northwind.svc/";

var oModel = new sap.ui.model.odata.ODataModel(url, true);

sap.ui.getCore().setModel(oModel);

var oTable = new sap.ui.table.Table("table", { // create Table UI

title: "Northwind - Orders",

columns : [

{label: "ID", template: "OrderID" },

{label: "Date", template: "OrderDate" },

{label: "Contact Name", template: "Customer/ContactName"}

]

});

oTable.bindRows({

path: "/Orders",

// path: "/Orders(10251)",

parameters: {

expand:"Customer"

}

}); // bind the table rows

oTable.placeAt("content"); // place Table onto UI

</script>

</head>

<body class="sapUiBody" role="application">

<div id="content"></div>

</body>

</html>

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

Regards

Henry