MSCRM Javascript confirm box - New feature in MSCRM 2015
Say good bye to normal java script confirm box. Microsoft Provided a new confirm box in new version 2015.
Syntax:
Xrm.Utility.confirmDialog(message, yesCloseCallback, noCloseCallback)
How to use it:
1. Call "GetCurrentStageName" function on Opportunity form load event.
function GetCurrentStageName() {
var formType = Xrm.Page.ui.getFormType();
if (formType == 2 || formType == 3 || formType == 4) {
var activeStage = Xrm.Page.data.process.getActiveStage();
var stageName = activeStage.getName();
Xrm.Utility.alertDialog(stageName, onCloseCallback)
}
}
function onCloseCallback() {
var message = "This is javascript confirm box";
Xrm.Utility.confirmDialog(message, yesCloseCallback, noCloseCallback)
}
function yesCloseCallback() {
Xrm.Utility.alertDialog("you clicked on Yes");
}
function noCloseCallback() {
Xrm.Utility.alertDialog("you clicked on No");
}
Applies To: CRM 2015 on-prem, CRM Online
Syntax:
Xrm.Utility.confirmDialog(message, yesCloseCallback, noCloseCallback)
How to use it:
1. Call "GetCurrentStageName" function on Opportunity form load event.
function GetCurrentStageName() {
var formType = Xrm.Page.ui.getFormType();
if (formType == 2 || formType == 3 || formType == 4) {
var activeStage = Xrm.Page.data.process.getActiveStage();
var stageName = activeStage.getName();
Xrm.Utility.alertDialog(stageName, onCloseCallback)
}
}
function onCloseCallback() {
var message = "This is javascript confirm box";
Xrm.Utility.confirmDialog(message, yesCloseCallback, noCloseCallback)
}
function yesCloseCallback() {
Xrm.Utility.alertDialog("you clicked on Yes");
}
function noCloseCallback() {
Xrm.Utility.alertDialog("you clicked on No");
}
Applies To: CRM 2015 on-prem, CRM Online
Comments
Post a Comment