Skip to content

Commit 1e75f69

Browse files
taking over review comments
1 parent 6fd7df2 commit 1e75f69

File tree

1 file changed

+13
-18
lines changed

1 file changed

+13
-18
lines changed

advanced/fiori.md

Lines changed: 13 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -472,34 +472,29 @@ For more details, see the [official UI5 documentation](https://ui5.sap.com/#/top
472472

473473
### Validating Drafts
474474

475-
CAP provides _state messages_ to the UI5 OData V4 model. This enables validations of drafts and giving feedback about errors to users faster in the UI.
476-
477-
::: warning Requires OData V4 and UI5 version >=1.135.0
478-
The _state messages_ feature relies on UI5 to use _document URLs_. That's because, with this feature enabled, CAP sets the annotation `@Common.AddressViaNavigationPath` to instruct UI5 to use _document URLs_. In turn, this requires OData V4 and UI5 version >= 1.135.0. OData V2 does not support the annotation.
479-
:::
480-
481-
If required, for example because of usage of OData V2, this feature can be disabled with <Config>cds.fiori.draft_messages:false</Config>.
482-
483-
This feature adds additional elements to your draft-enabled entities and [`DraftAdministrativeData`](/guides/security/data-protection-privacy#dpp-cap), which are required to store and serve state messages. For this to work, the CAP runtimes support persisting (error) messages for draft-enabled entities.
484-
485-
In addition, you can observe the following improvements, without any changes to the application code:
486-
487-
- Error messages for annotation-based validations (for example, `@mandatory` or `@assert...`) already appear while editing the draft.
488-
- Custom validations can now be registered to the `DRAFT_PATCH` event and can write (error) messages. It's ensured that the invalid value is still persisted, as expected by the draft choreography.
489-
- Messages no longer unexpectedly vanish from the UI after editing another field.
490-
- Messages are automatically loaded when reopening a previously edited draft.
491-
492-
By default, when activating this state messages, side-effect annotations are generated in the EDMX that instruct UI5 to fetch state messages after every `PATCH` request. If you require more precise control over side-effect annotations, you can disable the side-effect annotation per entity:
475+
With Fiori draft state messages, you benefit from the following improvements without any change in your application code:
476+
- The UI displays error messages for annotation-based validations (such as `@mandatory` or `@assert...`) while editing drafts.
477+
- You can register [custom validations](#custom-validations) to the `PATCH` event and write (error) messages. The draft choreography ensures the invalid value still persists.
478+
- Messages remain visible in the UI, even after editing other fields.
479+
- The UI automatically loads messages when reopening a previously edited draft.
480+
CAP generates side-effect annotations in the EDMX to instruct UI5 to fetch state messages after every `PATCH` request. To control side-effect annotations more precisely, override or disable them per entity:
493481

494482
```cds
495483
// Setting `null` disables the side-effect annotation for always fetching messages.
496484
annotate MyService.MyEntity with @Common.SideEffects #alwaysFetchMessages: null;
497485
```
498486

487+
To enable this feature, CAP adds additional elements to your draft-enabled entities and [`DraftAdministrativeData`](/guides/security/data-protection-privacy#dpp-cap) to store and serve the state messages. CAP runtimes persist (error) messages for draft-enabled entities.
488+
499489
::: warning Requires Schema Update
500490
This feature initiates a database schema update, as it adds an additional element to `DraftAdministrativeData`.
501491
:::
502492

493+
::: warning Requires OData V4 and UI5 version >=1.135.0
494+
State messages require UI5 to use _document URLs_. CAP sets the `@Common.AddressViaNavigationPath` annotation to enable this. You need OData V4 and UI5 version >= 1.135.0. OData V2 does not support this annotation.
495+
:::
496+
To disable this feature, set <Config>cds.fiori.draft_messages:false</Config>.
497+
503498

504499
#### Custom Validations
505500

0 commit comments

Comments
 (0)