Skip to content

Instantly share code, notes, and snippets.

@cgillis-aras
Created October 21, 2021 12:59
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/22a72fa730fbd956ad444375634db717 to your computer and use it in GitHub Desktop.
Save cgillis-aras/22a72fa730fbd956ad444375634db717 to your computer and use it in GitHub Desktop.
Sample code for Aras Innovator to open a classification dialog before opening a new item of that classification.
const itemType = options.itemType;
// Open up a classification dialog
var param = {
aras: aras,
isEditMode: true,
itemTypeName: itemType.name,
class_structure: itemType.class_structure,
dialogType: 'classification',
selectLeafOnly: true,
isRootClassSelectForbidden: true,
resizable: true,
content: 'ClassStructureDialog.html'
};
ArasModules.MaximazableDialog.show('iframe', param).promise.then(function(value) {
value = value || "";
// Create a new Item
let node = aras.newItem(itemType.name);
if (node) {
// Set the chosen classification
aras.setItemProperty(node, "classification", value);
aras.itemsCache.addItem(node);
// Then open a window to display that new item
aras.uiShowItemEx(node, 'new');
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment