Skip to content

Instantly share code, notes, and snippets.

@cgillis-aras
Created November 3, 2017 20:44
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 cgillis-aras/4ba88493409e5aca8edd37073f8d2399 to your computer and use it in GitHub Desktop.
Save cgillis-aras/4ba88493409e5aca8edd37073f8d2399 to your computer and use it in GitHub Desktop.
// We need to pass the ID of the form into the dialog
var formNd = top.aras.getItemByName("Form", "Dialog Example", 0);
// Set the arguments being passed to the dialog
var param = {
title: "Dialog Example",
aras: top.aras,
formId: formNd.getAttribute("id"),
isEditMode: true
};
// Set the size of the resuling dialog
var options = {
dialogWidth: 500,
dialogHeight: 250
};
// This will be called after the dialog is closed
var callback = {
oncancel: function(dialogWrapper) {
var res = dialogWrapper.result;
if (res.usersName) {
alert(res.usersName + " loves learning about dialogs!");
}
}
};
// Open the dialog
var topWnd = top.aras.getMostTopWindowWithAras();
var wnd = topWnd ? topWnd : window;
wnd.aras.modalDialogHelper.show('DefaultPopup', wnd, param, options, 'ShowFormAsADialog.html', callback);
alert("Before the dialog");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment