diff --git a/guides/uis/fiori.md b/guides/uis/fiori.md index 4972497fb..47218cc14 100644 --- a/guides/uis/fiori.md +++ b/guides/uis/fiori.md @@ -491,6 +491,7 @@ You can add your validation logic before the operation handler for either CRUD o
+ ### Query Drafts Programmatically To access drafts in code, you can use the [`.drafts` reflection](../../node.js/cds-reflect#drafts). @@ -500,6 +501,42 @@ SELECT.from(Books.drafts) //returns all drafts of the Books entity [Learn how to query drafts in Java.](../../java/fiori-drafts#draftservices){.learn-more} + +### Direct CRUD + +With cds.fiori.direct_crud:true, creating or modifying active instances directly is possible without creating drafts. +This comes in handy when technical services without a UI interact with each other. + +That is, you can then create and modify active instances directly: + +```http +POST /Books + +{ + "ID": 123 +} +``` + +```http +PUT /Books(ID=123) + +{ + "title": "How to be more active" +} +``` + +For this, the default draft creation behavior by SAP Fiori Elements is redirected to a collection-bound action via annotation `@Common.DraftRoot.NewAction`. +The thereby freed `POST` request to draft roots without specifying `IsActiveEntity` leads to the creation of an active instance (as it would without draft enablement). + +The feature is required to enable [SAP Fiori Elements Mass Edit](https://sapui5.hana.ondemand.com/sdk/#/topic/965ef5b2895641bc9b6cd44f1bd0eb4d.html), allowing users to change multiple objects with the +same editable properties without creating drafts for each row. + +:::warning Additional entry point +Note that this feature creates additional entry points to your application. Custom handlers are triggered with delta +payloads rather than the complete business object. +::: + + ## Use Roles to Toggle Visibility of UI elements In addition to adding [restrictions on services, entities, and actions/functions](../security/authorization#restrictions), there are use cases where you only want to hide certain parts of the UI for specific users. This is possible by using the respective UI annotations like `@UI.Hidden` or `@UI.CreateHidden` in conjunction with `$edmJson` pointing to a singleton. diff --git a/node.js/fiori.md b/node.js/fiori.md index eed9479cc..2d5339d8f 100644 --- a/node.js/fiori.md +++ b/node.js/fiori.md @@ -191,48 +191,12 @@ It can occur that inactive drafts are still in the database after the configured ## Bypassing Drafts {.deprecated} -Use [Direct CRUD](#direct-crud) instead. +Use [Direct CRUD](../guides/uis/fiori#direct-crud) instead. Until the next major release (`cds10`), you can still activate the draft bypass without also allowing direct CRUD via cds.fiori.bypass_draft:true. -## Direct CRUD - -With cds.fiori.direct_crud:true, creating or modifying active instances directly is possible without creating drafts. -This comes in handy when technical services without a UI interact with each other. - -That is, you can then create and modify active instances directly: - -```http -POST /Books - -{ - "ID": 123 -} -``` - -```http -PUT /Books(ID=123) - -{ - "title": "How to be more active" -} -``` - -For this, the default draft creation behavior by SAP Fiori Elements is redirected to a collection-bound action via annotation `@Common.DraftRoot.NewAction`. -The thereby freed `POST` request to draft roots without specifying `IsActiveEntity` leads to the creation of an active instance (as it would without draft enablement). - -The feature is required to enable [SAP Fiori Elements Mass Edit](https://sapui5.hana.ondemand.com/sdk/#/topic/965ef5b2895641bc9b6cd44f1bd0eb4d.html), allowing users to change multiple objects with the -same editable properties without creating drafts for each row. - -:::warning Additional entry point -Note that this feature creates additional entry points to your application. Custom handlers are triggered with delta -payloads rather than the complete business object. -::: - - - ## Programmatic APIs You can programmatically invoke draft actions with the following APIs: