Created
August 3, 2021 19:23
-
-
Save melamriD365/b40eff5617a8a79e378751eaaafa1645 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function openDialog(exectionContext) { | |
var dialogParameters = { | |
pageType: "custom", | |
name: "new_dialogsample_bb2dc", | |
}; | |
var navigationOptions = { | |
target: 2,//use 1 if you want to open page inline or 2 to open it as dialog | |
width: 800, // value specified in pixel | |
height: 420, | |
position: 1,//1 to locate dialog in center and 2 to locate it on the side, | |
} | |
Xrm.Navigation.navigateTo(dialogParameters, navigationOptions).then( | |
function () { | |
let data = JSON.parse(sessionStorage.getItem("dialogKey")); | |
console.log(data); | |
// define notification object | |
var notification = | |
{ | |
type: 1, | |
level: 1, //error | |
message: data.context | |
} | |
Xrm.App.addGlobalNotification(notification).then( | |
function success(result) { | |
console.log("Notification created with ID: " + result); | |
// perform other operations as required on notification display | |
}, | |
function (error) { | |
console.log(error.message); | |
// handle error conditions | |
} | |
); | |
}, | |
function (e) { | |
//put your error handler here | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment