Skip to main content

Notifications

Day 3 - Basic event handling - Onload, Onchange in MSCRM / Dataverse

 Introduction:


In this blog we will see how to use Basic event handling - Onload, Onchange in MSCRM / Dataverse


function onChange(executionContext) {
    var formContext = executionContext.getFormContext();

    if (formContext.getAttribute("bosch_dayname").getValue() != null) {
        var alertStrings = { confirmButtonLabel: "Yes", text: formContext.getAttribute("bosch_dayname").getValue(), title: "Throw Alert" };
        var alertOptions = { height: 120, width: 260 };
        Xrm.Navigation.openAlertDialog(alertStrings, alertOptions).then(
            function (success) {
                console.log("Alert dialog closed");
            },
            function (error) {
                console.log(error.message);
            }
        );
    }
}


Comments