on 11-18-2021 10:00 PM
Hi,
I am trying the latest version of sap/cds : 5.6.3 . I have a simple calculation view which I am trying to use a update handler.This seems not working anymore.
//data model
-----------------------------------------------------------------------------
@cds.persistence.exists
@cds.persistence.calcview
entity CV_TEST {
key ID : Integer;
book : String(100);
country : String(100);
amount : Integer;
}
//service Definition
-------------------------------------------------------------------------------------
using CV_TEST as _CV_TEST from '../db/data-model';
service CatalogService @(impl: 'cat-service.js'){
entity TEST as projection on _CV_TEST;
}
//handler
--------------------------------------------------------------------
this.before('UPDATE','TEST', async(req) => { console.log('Hi') });
Full project : https://github.com/mani-gitarea/updateIssueCAP/
Error: When I do PUT on an entity http://localhost:8000/catalog/TEST(ID=1)
{<br> "error": { "code": "361", "message": "data manipulation operation not legal on this view:
CV_TEST: line 1 col 8 (at pos 7)", "@Common.numericSeverity": 4 }}
It is a simple update handler on a view. I am not sure what is the mistake here.Can you please guide.
Hi Manikandan, The error occurs in the database, which cannot do an update for a calc view. Please try to add the annotation @cds.persistence.skip and implement the custom logic completely (including .on handler): https://cap.cloud.sap/docs/guides/providing-services#custom-handlers
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
83 | |
9 | |
9 | |
8 | |
7 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.