cancel
Showing results for 
Search instead for 
Did you mean: 

Disable draft handling in CAP

0 Kudos
121

I wanted to build an app using CAP that has transactional capabilities. Since the app is completely based on a remote service, I need to have custom handler logic to handle CRUD operations. In cap, in order to enable create/update, the entity needs to be annotated with draft enabled. We don't need draft because we are not persisting the data and the entity is already annotated with persistence skip whenever we create the entity as a projection on remote service.

Is there a way to perform create/update in a CAP app by disabling the draft functionality. I tried the annotation @odata_draft_bypass and it does not work. 

View Entire Topic
MioYasutake
Active Contributor

@sivathanushan_kokilathas 

One possible approach is to use OData V2, as Fiori elements based on OData V2 do not require draft.

https://cap.cloud.sap/docs/advanced/odata#odata-v2-adapter-node