2024 Dec 24 4:47 PM - edited 2024 Dec 24 5:05 PM
I have created a cap app and deployed to CF and all the CRUD functionality are working as expected. I tried to consume the deployed service as an OData service in another cap app. I created a service by consuming the existing OData services with only the required fields. I enabled the draft functionality but I am having issue with create and update from the app. I have implemented custom logic for all CRUD and create/update does not work as expected.
Request clarification before answering.
The custom handlers are only triggered once you save the draft into the "steady state". If you want to have custom handlers for draft entities you can find the instructions here: https://cap.cloud.sap/docs/node.js/fiori#programmatic-invocation-of-draft-actions
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I tried using the above node js draft handler to have my custom logic and I also tried the one documented in the below link.
https://cap.cloud.sap/docs/node.js/fiori#draft-support
But these are not getting triggered when I create an entity that is a projection of an external Odata V4 services and I cannot save the draft values during create/update. When logging the events, I cannot see any events triggered for New, draftPrepare and draftActivate. However, when I create projection on local entitles defined within the schema, these events works as expected.
--CREATE BUTTON (on object page aka save record) ------------------------------------------------------
[odata] - POST /odata/v4/person/$batch
[odata] - > CREATE /Person(id=999,IsActiveEntity=false)/PersonService.draftPrepare
[cds] - ❗️Uncaught TypeError: Cannot read properties of undefined (reading 'name')
| User | Count |
|---|---|
| 7 | |
| 6 | |
| 6 | |
| 5 | |
| 4 | |
| 3 | |
| 3 | |
| 3 | |
| 3 | |
| 3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.