How to Show Confirm Dialog Box using JavaScript? How to display a progre...



Code:
function PromptDialog(executionContext) {
    var confirmStrings = {
        text: "Do you want to proceed?",
        title: "Confirmation",
        confirmButtonLabel: "Yes",
        cancelButtonLabel: "No"
    };
    var confirmOptions = {
        height: 200,
        width: 400
    };
    Xrm.Navigation.openConfirmDialog(confirmStrings, confirmOptions).then(
        function (success) {
            if (success.confirmed == true) {
                CallMethod(executionContext); // Pass executionContext if needed
            } else {
                // User clicked No
            }
        }
    );
}

function CallMethod(executionContext) {
    // Accessing formContext if needed
    var formContext = executionContext.getFormContext();
    var fielda = formContext.getAttribute("zxc_promptdialog").getValue();
    Xrm.Utility.showProgressIndicator(fielda + " This is Progress Indicator. It will close after 5 seconds.");
    setTimeout(function () {
        Xrm.Utility.closeProgressIndicator();
    }, 5000);
}

Comments

Popular posts from this blog

GET/SET different field values using JavaScript and generate unique name...

Update Related Records Workflow