Customizing Item Menus with CUI

Customizing Item Menus with CUI

In previous blog posts, we've covered how to add custom menu items like buttons and shortcuts using the Configurable User Interface (CUI) data model introduced in 11.0 SP7. Using this same data model, it's also possible to add menu items that are specific to individual ItemTypes that you want to have special functionality.

The Use Case

In our example, we'll imagine that we've just received a requirement to prevent users from adding CAD items through the Aras Innovator UI since we expect that all CAD items will be created via a CAD Converter. We can't simply remove the Can Add permissions from the ItemType because our users still need those permissions to add items through the converter. To satisfy this requirement, we'll instead remove the Create New CAD Document menu option from the CAD form using CUI.

Updating the CUI

Add a Presentation Configuration

Presentation Configurations (PCs) are the top-level CUI items that are used to let the client know that sections of the interface are going to be represented using CUI. We've previously modified the Global Presentation Configuration which describes what the default UI will look like for any given view. However, each ItemType can also have a relationship to its own PC. Any changes made to these ItemType-specific PCs will be applied on top of the Global Presentation Configuration, so you don't have to worry about defining an entire UI if you just want to add one button. We can find the Presentation Configuration of the CAD ItemType by following the steps below.

  1. Login as admin
  2. Navigate to TOC > Administration > ItemTypes
  3. Search for and open CAD
  4. Click on the Client Style relationship tab
  5. Open the related item

If you're using Aras Innovator 12.0, you'll probably find an existing relationship on most ItemTypes since these PCs are now used to represent the entry in the Table of Contents. If you do not find an existing item here, you can create a new one and give it an appropriate name.

Add a Command Bar Section

A Command Bar Section represents a specific portion of the UI such as the toolbar of the main search grid or, in our case, the toolbar of our form. Let's go ahead and add a new section to the Presentation Configuration of the CAD ItemType.

  1. In the Command Bar Section relationship tab, add a new related item 
    1. Classification - Data Model
    2. Name - My Custom CAD UI
    3. Location - ItemView.ItemCommandBar
    4. For Identity [...] - World
  2. Open this new item

Add a Command Bar Item

A Command Bar Item represents an individual UI component like a button or a keyboard shortcut. Because our goal is to hide an existing button, we're going to add a relationship by picking an existing Command Bar Item. In general, standard CUI items will follow a naming convention like LOCATION.PARENT_MENU.PURPOSE. For example, we're trying to find the item that represents the Create a New Item button. We also know that the Location is called ItemView.ItemCommandBar, so we can try searching for itemview*new*

It's the first result with that search criteria! Let's pick this item, and then configure it to be removed from the UI for all of our users.

  1. In the Command Bar Item relationship tab, pick a related item 
    1. name - itemview.itemcommandbar.default.more.createnew
    2. Action - Remove
    3. For Identity [...] - World
  2. Save the parent Command Bar Section
  3. Close the tab for the Command Bar Section
  4. Save the parent Presentation Configuration

Test Our Changes

Once our changes are made and saved, we can see them in action by opening up any CAD item and trying to add a new CAD. 

Ideas For Your Own Customizations

If you're looking for more ways to flex your CUI skills, try out some of the ideas below. If you've already used CUI to make a handy customization, consider creating a community project to share it. 

  1. Remove the Create New CAD Document option from the TOC Context Menu (hint: the location is called PopupMenuMainWIndowTOC)
  2. Add a new menu option just for Administrators (hint: try changing the For Identity [...])
  3. Use Replace action to substitute an existing menu option with a custom menu option (hint: try using the Alternate [...] field)

Looking for more Aras inspiration?

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.