Skip to content

Instantly share code, notes, and snippets.

@cgillis-aras
Created January 16, 2019 16:03
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/8f8f9f39badea823eb219d3b13e185cb to your computer and use it in GitHub Desktop.
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.
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