Multi-select Item Actions in Aras Innovator

Actions are one of the most common ways users interact with data in Aras, whether from the main grid, item forms, or main menu. While creating custom actions is fairly straightforward, creating multi-select item actions requires the use of a built-in method called PE_GetSelectedItems. This post demonstrates how to use PE_GetSelectedItems to implement a multi-select item action that copies property data from the selected items to the clipboard.

Getting Started

The code shown below is part of the Copy to Clipboard Aras Community Project. If you want to apply the project or view the source code in its entirety, you can find it on the Aras Labs GitHub:


copy-to-clipboard – Contains sample code to demonstrate how to copy text to the clipboard in an Aras client-side action.

The PE_GetSelectedItems Method

The PE_GetSelectedItems method is part of the Aras Product Engineering application. It’s included in every InnovatorSolutions database (the default database option in the Aras Innovator installer). On a high level, the PE_GetSelectedItems gets all the selected items, whether from a relationship grid, main grid or form, and returns a collection of the selected items.

Check out the PE_AddToChange action for a built-in Aras action that uses PE_GetSelectedItems.

Creating the ‘Item to Clipboard’ Method

The method we need for the Copy to Clipboard action can be broken into three basic steps. First, we need to get the collection of items passed into the method from PE_GetSelectedItems.

Next we need to loop through the collection of selected items and build a string from the items’ property data. In the sample code provided in the Copy to Clipboard project, we use the item_number and name properties from Part. Be sure to update the properties referenced in the method if plan to use the action with another ItemType.

Now that we’ve built a string containing the data we want to copy, we can use a couple helpful functions provided by the Aras Innovator client. Not all browsers allow programmatic access to the clipboard, so we’ll use the aras.utils.isClipboardSupported() function to check.

If clipboard access is permitted, we will use the copyToBuffer() function shown below. This function is based on the code behind the Copy ID button in the item properties dialog. If our current browser does not allow access to the clipboard, we will output the data in an alert dialog so users can manually copy it.

Creating the Action

The Copy to Clipboard action requires the following properties to work as a multi-select item action. Other properties (name, label, target, etc.) can be set to fit your use case.

  • Type: Item
  • Location: Client
  • Method: PE_GetSelectedItems
  • On Complete: Item to Clipboard

The “method” property must be set to PE_GetSelectedItems in order to pass the collection of selected items to our custom method – Item to Clipboard. Without PE_GetSelectedItems, only the last selected item would be available to our method code.

Final Result

Once you attach your Copy to Clipboard action to an ItemType’s Action tab, you will be able to select multiple items and copy their data to your clipboard.


Subscribe to our blog and follow @ArasLabs on Twitter for more helpful content! You can also find our latest open-source projects and sample code on the Aras Labs GitHub page.

One thought on “Multi-select Item Actions in Aras Innovator

  1. rneuber1

    For some use cases there is a way to achieve this without the use of PE_GetSelectedItems: Within the method, simply check if this.getID() is the first selected id. If not, just do nothing, otherwise iterate over grid.getSelectedItems. This means, the method is invoked for every item but does nothing for all but the first invocation. In this case, we iterate over all selected items and process them. This should not be done for actions that open a window on their own, because this would result in multiple blank windows. But for most use cases this proved a practical solution. (Code below is for Aras 9.4)

    var grid = null;
    var inn = this.getInnovator();

    // check where we are
    if( top.main && && )
    grid =; // here we are on the main grid
    } // if( top.main …
    else if( top.relationships && top.relationships.frames[1] && top.relationships.frames[1].grid )
    grid = top.relationships.frames[1].grid; // here we are in the relationship grid
    } // else if( top.relationships …

    if( grid ) // check if we are in any grid
    var idArray = grid.getSelectedItemIds(“,”).split(“,”);
    if( idArray[0] == this.getID() ) // this check handles execution – only once at first element
    // This branch executes the logic
    for( var c = 0; c < dArray.length; c++ )
    var cur = inn.getItemById( this.getType(), idArray[c]);

    // Treat item 'cur'


Leave a Reply