Created
October 21, 2021 12:59
-
-
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.
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
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