Instantly share code, notes, and snippets.

Embed
What would you like to do?
Sample code for Aras Innovator to get the keyed_names of all selected items in the main grid.
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