on 06-19-2023 7:14 AM
Hello all,
I am developing a CAP supported Fiori Elements application with OData V4. Currently I am struggling with getting the onpremise OData Service data into a valuehelp in frontend. The issue is whenever the batch call is triggered it adds a "$count" parameter into the call URI which is not supported by the backend (error can be seen in /IWNFD/ERROR_LOG).
Since Fiori Elements template is used, this call takes place automatically over a CAP Service that wraps the backend OData Service call. It has a very basic service js as can be seen below. Even converting the frontend model into OData V2 didn't help since "inlinecount" param was also not supported in backend.
const cds = require("@sap/cds");
module.exports = async function () {
const inspectionLotService = await cds.connect.to("INSPECTION_LOT_SRV");
this.on("READ", "Plant_VHSet", async function (request)
{
return await inspectionLotService.tx(request).run(request.query);
});
};
Batch URI in OData V4 Call:
GET Plant_VHSet $select=City1,Name1,Name2,Nation,PostCode1,Werks&$count=true&$orderby=Werks&$skip=0&$top=58<br>
Batch URI in OData V2 Call:
GET Plant_VHSet?$inlinecount=allpages&$orderby=Werks&$select=City1,Name1,Name2,Nation,PostCode1,Werks&$skip=0&$top=58
Both URI calls ends with error in backend. A workaround would be deleting the count parameter from the query before sending it to backend. But I would like to find a more official solution, removing the count off of from the query via a configuration etc.
I appreciate for any comment and help,
Thanks in advance,
Best,
Merve
Please replace:
"kind": "odata"
with
"kind": "odata-v2"
then it should work.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
77 | |
9 | |
9 | |
7 | |
7 | |
6 | |
6 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.