Toolbars

Add a button to an item toolbar

“I want to add a button to the Part item toolbar for all users.”

Figure 16. A custom button appears in the Part item toolbar

Note
This section demonstrates how to add a Command Bar Item to the Item View toolbar for a specific ItemType. See the “Add a separator to a toolbar” section for steps to add a Command Bar Item to the Item View toolbar for all ItemTypes.

  1. Open the Part ItemType and select the Client Style relationship tab.
  2. Right click the entry in the grid and select Open to open the Presentation Configuration for the Part ItemType.
  3. Click the Edit button.
  4. Click the New button in the Command Bar Section grid to create a new section with the following properties:

    1. Classification: Data Model
    2. Name: Part_Custom_Buttons
    3. Location: ItemView.ItemCommandBar
    4. Sort Order: 256
    5. For Identity: World
  5. Click the Save button, then right click the new Command Bar Section, and select Open.
  6. Click the Edit button.
  7. Click the New button in the Command Bar Item grid, then select Button > OK in the dialog to create a new button with the following properties:

    1. Name: My_Button
    2. Sort Order: 2000
    3. Action: Add
    4. For Identity: World
  8. Click Save, then right click the new Button, and select Open.
  9. Click the Edit button.
  10. Set the following properties on the item form:
    1. Label: enter the label you want to appear on the button
    2. Click Method: choose a Method you want to execute when the button is clicked
    3. Image: choose an icon to display in the button
  11. Click Save, then navigate to Design > Parts in the TOC.
  12. Open a Part item to see the new button in the toolbar.

Add a separator to all item toolbars

“I want to add a separator before the Refresh button in the toolbar for all ItemTypes and users.”

Figure 17. A custom separator appears before the refresh button in all item toolbars

Note
This section demonstrates how to add a Command Bar Item to the Item View toolbar for all ItemTypes. See the “Add a button to a toolbar” section for steps to add a Command Bar Item to the Item View toolbar for a specific ItemType.

  1. Navigate to Administration > Configuration > Client Presentation in the TOC.
  1. Click the Search button to run the Client Presentation search.
  2. Click the Global item property in the single search result.
  3. In the Command Bar Section grid, open the itemview.itemcommandbar.default item.
  4. Click the Edit button.
  5. Click the New button in the Command Bar Item grid, then select Separator > OK in the dialog to create a new separator with the following properties:
    1. Name: My_Separator
    2. Sort Order: 500
    3. Action: Add
    4. For Identity: World
  6. Click the Save button.
  7. Open any item to see the new separator appear before the Refresh button in the toolbar.

Remove a button on a relationship toolbar

“I want to hide the Share button on the Part BOM relationship toolbar for members of All Suppliers.”

Figure 18. The default “share” button does not appear on Part BOM for All Suppliers

  1. Open the Part BOM ItemType and click the Edit button.
  2. In the Client Style relationship tab, click the New button to create a new Presentation Configuration with the following properties:

Name: Part_BOM

  1. Click the Save button, then right click the new Presentation Configuration, and select Open.
  1. Click the Edit button.
  2. Click the New button in the Command Bar Section grid to create a new section with the following properties:
    1. Classification: Data Model
    2. Name: Part_BOM_Custom
    3. Location: ItemView.RelationshipsCommandBar
    4. Sort Order: 128
    5. For Identity: All Suppliers
  3. Click the Save button, then right click the new Command Bar Section, and select Open.
  4. Click the Edit button.
  5. Click the Add button in the Command Bar Item grid, then search for the commonitems.commandbar.sharemenu item. Click OK in the search dialog to add the item to the Command Bar Items grid.
  1. Set the following properties for the Command Bar Item:
    1. Action: Remove
    2. For Identity: All Suppliers
  2. Click Save, then logout of Aras Innovator.
  3. Login to Aras Innovator as a member of the All Suppliers group identity.
  4. Open a Part item to see that the Share button no longer appears in the Part BOM relationship toolbar.

Replace a button on a toolbar

“I want to replace the default “New” button with a custom button on the Part search toolbar for all users.”

Figure 19. The default “new” button is replaced with a custom button in the search toolbar.

  1. Open the Part ItemType and select the Client Style relationship tab.
  2. Right click the entry in the grid and select Open to open the Presentation Configuration for the Part ItemType.
  3. Click the Edit button.
  4. Click the New button in the Command Bar Section grid to create a new section with the following properties:
    1. Classification: Data Model
    2. Name: Part_Search_Custom_Buttons
    3. Location: SearchView.CommandBar
    4. Sort Order: 512
    5. For Identity: World
  5. Click the Save button, then right click the new Command Bar Section, and select Open.
  6. Click the Edit button.
  7. Click the Add button in the Command Bar Item grid, then search for the searchview.commandbar.default.new item. Click OK in the search dialog to add the item to the Command Bar Items grid.
  8. Set the following properties for the Command Bar Item:
    1. Sort Order: 2000
    2. Action: Replace
    3. For Identity: World
  9. Click Save, then right click the Button, and select Open.
  10. Click the “” button in the toolbar and select Create New Button to create a new Button with the following properties:
    1. Name: My_New_Button
    2. Label: New
    3. Tooltip Template: New {0}
    4. Init Method: cui_svcb_new_init
    5. Click Method: cui_ivicb_more_new_click
    6. Image: choose an icon to display in the button
  1. Click Save, then navigate back to the Part_Search_Custom_Buttons Command Bar Section tab.
  2. In the Alternate property of the searchview.commandbar.default.new Command Bar Item relationship, enter My_New_Button.
  1. Click Save, then navigate to Design > Parts in the TOC to see the custom “New” button in the search toolbar.