Skip to content

Instantly share code, notes, and snippets.

@melamriD365
Created August 3, 2021 19:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save melamriD365/b40eff5617a8a79e378751eaaafa1645 to your computer and use it in GitHub Desktop.
Save melamriD365/b40eff5617a8a79e378751eaaafa1645 to your computer and use it in GitHub Desktop.
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