Removing 'Purge' from menu for specific ItemType

Is it possible to remove/hide a menu 'item' e.g 'Purge'  from the 'Main Window Main Menu' for a specific ItemType. Seems like you can do this for the 'Tearoff Window Main Menu' by adding a init method to the com.aras.innovator.cui_default.twmm_purge 'Menu Button'. The method i adds looks like this ----- var aWindow = top.aras.getMainWindow() == window.top ? top.aras.getMainWindow() : window; var workerFrame = aWindow.work; if (workerFrame.itemTypeName === 'myItemType' || workerFrame.itemTypeName === 'myOtherItemType') { return {'cui_invisible': true}; } ------ If i try to do the same thing for the com.aras.innovator.cui_default.mwmm_purge menu Button the results seems to be a bit weird (works for 'myItemType' but not for 'myOtherItemType'???). I assume the difference lies in when the init method is run for the different menues ?? Any suggestions ? /regards Johan R.  
  • Hi Johan, There is a built-in way to remove specific UI buttons that does not require any additional code. Please follow the steps below to remove the purge button from an ItemType.
    1. Open the 'myItemType' ItemType
    2. Navigate to the 'Client Style' relationship tab
    3. Open this item if one exists
      1. If an item does not exist in this tab, create one
    4. Disable the 'Purge' button from the Main Window Main Menu for this ItemType
      1. In the Command Bar Section relationship tab, select "Create Related" and add a new item with the information below
        • Classification: Data Model
        • Name: myItemType Main Window Main Menu
        • Location: Main Window Main Menu
        • For Identity [...]: World
          • Alternatively, you can hide this button only for certain Identities
      2. Open this new Item
      3. In the Command Bar Item relationship tab, select "Pick Related" and add a new item
      4. Search for the button named "com.aras.innovator.cui_default.mwmm_purge"
      5. Set the Action for this item to "Remove"
      6. Set the For Identity [...] to "World"
      7. Save, Unlock, and Close each window until you get back to the main grid.
    You can follow similar steps to hide the Purge option in other locations such as the Main Window Toolbar, the Tearoff Window Main Menu, etc. Chris __________________________ Christopher Gillis Aras Labs Software Engineer
  • Should this work with Aras 12? I'm looking to hide Part 'LifeCycle' from menu other than Admins.