Skip to content

Commit 99bb7d4

Browse files
arleytmjohannes-vogelrenejeglinsky
authored
feat(draft): Bypassing Draft Restrictions (#639)
* feat(draft): SAP Fiori Elements Mass Edit * add warning disclaimer * more broader context * minor * Update node.js/fiori.md Co-authored-by: Johannes Vogel <[email protected]> * add samples * add link to SAP Fiori Elements Mass Edit page * Apply suggestions from code review Co-authored-by: Johannes Vogel <[email protected]> * Update node.js/fiori.md Co-authored-by: René Jeglinsky <[email protected]> * formatting * fix merge conflict --------- Co-authored-by: Johannes Vogel <[email protected]> Co-authored-by: René Jeglinsky <[email protected]>
1 parent f51900a commit 99bb7d4

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed

node.js/fiori.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,51 @@ To prevent inconsistency, the entities with draft are locked for modifications b
8686
cds.drafts.cancellationTimeout=1h
8787
```
8888

89+
### Bypassing the SAP Fiori Draft Flow
90+
91+
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.
92+
93+
To enable this feature, set this feature flag in your configuration:
94+
95+
```json
96+
{
97+
"cds": {
98+
"fiori": {
99+
"bypass_draft": true
100+
}
101+
}
102+
}
103+
```
104+
105+
You can then create active instances directly:
106+
107+
```http
108+
POST /Books
109+
110+
{
111+
"ID": 123,
112+
"IsActiveEntity": true
113+
}
114+
```
115+
116+
You can modify them directly:
117+
118+
```http
119+
PATCH /Books(ID=123,IsActiveEntity=true)
120+
121+
{
122+
"title": "How to be more active"
123+
}
124+
```
125+
126+
This 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
127+
same editable properties without creating drafts for each row.
128+
129+
:::warning
130+
Note that this feature creates additional entry points to your application. Custom handlers are triggered with delta
131+
payloads rather than the complete business object.
132+
:::
133+
89134
### Garbage Collection of Stale Drafts
90135

91136
Inactive drafts can be deleted automatically after a timeout. You can configure this timeout by the following configuration:

0 commit comments

Comments
 (0)