Editar

Partilhar via


openAlertDialog

Displays an alert dialog containing a message and a button.

Available for

Model-driven apps

Syntax

context.navigation.openAlertDialog(alertStrings, options)

Parameters

Parameter Name Type Required Description
alertStrings AlertDialogStrings Yes The strings to be used in alert dialog. The AlertDialogStrings has the following attributes:
- text: string. The message to be displayed in the alert dialog.
- confirmButtonLabel:string. The confirm button label. If you do not specify the button label, OK (in user's preferred language) is used as the button label.
options AlertDialogOptions Yes Dialog options. The AlertDialogOptions has the following attributes:
- height: number. Height of the alert dialog in pixels.
- width: number. Width of the alert dialog in pixels

Return Value

Type: Promise

Remarks

See Promise and File

Example

context.navigation.openAlertDialog({text:"This is an alert.", confirmButtonLabel : "Yes",}).then(
      function success()
      {
         document.getElementById("openAlertDialogButton")!.innerHTML = "Alert dialog closed";
      },
      function()
      {
         document.getElementById("openAlertDialogButton")!.innerHTML = "Error in Alert Dialog";
      }
   );

Navigation
Power Apps component framework API reference
Power Apps component framework overview