Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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