Created
January 16, 2019 16:03
-
-
Save cgillis-aras/8f8f9f39badea823eb219d3b13e185cb to your computer and use it in GitHub Desktop.
Sample code for Aras Innovator to get the keyed_names of all selected items in the main grid.
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
var topWindow = aras.getMostTopWindowWithAras(window); | |
var workerFrame = topWindow.work; | |
var selectedIds = workerFrame.grid.getSelectedItemIds(); | |
var itemTypeName = workerFrame.itemTypeName; | |
var selItems = aras.IomInnovator.newItem(itemTypeName, "get"); | |
selItems.setAttribute("idlist", selectedIds.join(",")); | |
selItems.setAttribute("select", "id,keyed_name"); | |
selItems = selItems.apply(); | |
// Return the keyed_names of all selected items | |
var res = "Selected " + aras.getItemProperty(workerFrame.currItemType, "label_plural") + ":\n"; | |
for (var i = 0; i < selItems.getItemCount(); i++) | |
{ | |
var keyedName = selItems.getItemByIndex(i).getProperty("keyed_name"); | |
res = res + keyedName + "\n"; | |
} | |
return alert(res); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment