You can configure actions as critical, and when these actions are triggered, a confirmation popup is displayed for end users before the action is executed. For more information, see Adding Confirmation Popovers for Actions.
When end users create or edit an object page in a draft-enabled application and choose to leave the page without saving, the following popup is displayed:
The popup is enabled by default. You can disable it for external navigation by configuring specific settings in the
manifest.json
file. For more information, see the version-specific sections in this topic.
You can configure a confirmation popup for the following actions by sending an HTTP 412 response from the back end:
Standard SAP Fiori elements actions, such as Save, Activate, and Create.
Application-specific actions (function import actions in SAP Fiori elements for OData V2).
The flow is as follows:
When an action is triggered, the application sends a request with the header Prefer:handling=strict
.
Depending on the back-end settings, there are two options:
If the preference is unknown, it's ignored and the action is executed as usual.
If the preference is known, you can configure the back end to send a 412 message ("Precondition Failed" message).
For SAP Fiori elements, the 412 message indicates that there are warnings that block the processing of the action, but end users can still be trigger the action if they choose to ignore the warnings and continue.
The application displays a confirmation popup containing the message from the back end.
If end users choose
Confirm,
the application sends the request again, this time without
Prefer:handling=strict
in the header.
The back end executes the action and responds with either a success or a failure message.
If end users choose Cancel, the operation is terminated.
The following image shows an example of such a popup: