Fiori Action Confirmation Dialog with Custom Text
You have an action defined in the OData v4 service, and You like to to display a confirmation dialog box for the end user, eventually with a custom text. Note this works only for v4 not v2 and applies to the Fiori Elements (FE) List Report template (sap.fe.templates.ListReport).
Mark the Action as critical in the local annotations file
File is placed by default under webapp/annotations/annotation.xml
Here our Action is called Approve, originating from a RAP OData V4 UI service. As result the FE template display a MessageBox (popup to confirm 🙂 ) with the default text: Confirm This Action ?
<edmx:DataServices> <Schema xmlns="http://docs.oasis-open.org/odata/ns/edm" Namespace="local"> <Annotations Target="SAP__self.Approve"> <Annotation Term="com.sap.vocabularies.Common.v1.IsActionCritical" Bool="true" /> </Annotations> </Schema> </edmx:DataServices>
Customize the Dialog Text
Our Scenario:
- Entityset Name: PurchasingDocument
- Action Name: Approve
- Custom Text: Start the Tender ?
For all the possibilities for custom texts, read the Localization of UI Texts in UI5 docs.
Create custom i18n file under the existing webapp/i18n
folder called customI18N.properties
C_OPERATIONS_ACTION_CONFIRM_MESSAGE|PurchasingDocument|Approve=Start the Tender ?
Extend manifest.json to refer the custom i18n file with "enhanceI18n": "i18n/customI18N.properties",
"targets": { "GenerationList": { "type": "Component", "id": "PurchasingDocumentList", "name": "sap.fe.templates.ListReport", "options": { "settings": { "contextPath": "/PurchasingDocument", "variantManagement": "Page", "enhanceI18n": "i18n/customI18N.properties", "navigation": {
Do the same for the ObjectPage when needed, You can refer the same i18n file, no need for separate resources.
Share this content: