Think Dynamic, Do Dynamic Microsoft Dynamic CE | Powerapps || Dynamic CRM || Power Apps || Power Platform

Friday, 5 August 2022

HOW TO DISPLAY AN ALERT IN POWER APPS USING JAVASCRIPT

 HOW TO DISPLAY AN ALERT IN POWER APPS USING JAVASCRIPT


When using JavaScript, we can display alerts in model-driven Power Apps. To do this, we can use openAlertDialog.

The syntax for this method looks like below:


Xrm.Navigation.openAlertDialog(alertStrings,alertOptions).then(closeCallback,errorCallback);


As a simple example, we can use:


var confirmStrings = { text:"This is a confirmation.", title:"Confirmation Dialog" };

var confirmOptions = { height: 200, width: 450 };

Xrm.Navigation.openConfirmDialog(confirmStrings, confirmOptions).then(

function (success) {    

    if (success.confirmed)

        console.log("Dialog closed using OK button.");

    else

        console.log("Dialog closed using Cancel button or X.");

});

No comments:

Post a Comment

Popular Posts

Featured post

Understanding Dataverse MCP vs Power Apps MCP – Quick Review

  Understanding Dataverse MCP vs Power Apps MCP – Quick Review Model Context Protocol (MCP) has quickly become one of the hottest topics in ...

Post Top Ad

Your Ad Spot

Pages