Skip to content

Commit 5258693

Browse files
David-Kunzrenejeglinskysmahati
authored
feat: programmatic invocation of draft actions (#1437)
# will be released with @sap/cds 8.5.0 --------- Co-authored-by: René Jeglinsky <[email protected]> Co-authored-by: Mahati Shankar <[email protected]>
1 parent 4ff382d commit 5258693

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

node.js/fiori.md

+12
Original file line numberDiff line numberDiff line change
@@ -174,3 +174,15 @@ You can set the property to one of the following:
174174
- Draft-related properties (with the exception of `IsActiveEntity`) are only computed for the target entity, not for expanded sub entities since this is not required by Fiori Elements.
175175
- Manual filtering on draft-related properties is not allowed, only certain draft scenarios are supported.
176176
177+
178+
### Programmatic Invocation of Draft Actions <Beta />
179+
180+
You can programmatically invoke draft actions with the following APIs:
181+
182+
```js
183+
await srv.new(MyEntity, data) // create new draft
184+
await srv.discard(MyEntity.drafts, keys) // discard draft
185+
await srv.edit(MyEntity, keys) // create draft from active instance
186+
await srv.new(MyEntity).for(keys) // same as above
187+
await srv.save(MyEntity.drafts, keys) // activate draft
188+
```

0 commit comments

Comments
 (0)