Restricting Action on Multi select.

オフライン
Hi All, Is there any way to restrict an action menu on multiselect of the item grid. I found this article https://community.aras.com/en/tech-tip-disable-menu-button-using-cui/ for restricting the built in actions such as "save as" , "lock" etc based on the identity. However I want to be able to disable/hide a custom  action on multi select of the grid. Any idea on how I could acheive this functionality would be of great help . Thanks :)
Parents
  • Hello, It's not easily possible to disable this custom action as it doesn't exist as a CUI item. That being said, you can achieve a similar result by prompting the user with an error message if two or more items aren't selected. You can do this by changing the action to an ItemType action. This kind of action is always available from the main grid if you're viewing an ItemType it's attached to. You can then check for the number of selected items in the grid with a code sample like below.
    var selectedItems = window.work.grid.GetSelectedItemIDs();
    if (selectedItems.length < 2) {
    return aras.AlertWarning("This action requires two or more items to be selected");
    }
    // Put actual method logic below here
    Chris
    Christopher Gillis Aras Labs Software Engineer
Reply
  • Hello, It's not easily possible to disable this custom action as it doesn't exist as a CUI item. That being said, you can achieve a similar result by prompting the user with an error message if two or more items aren't selected. You can do this by changing the action to an ItemType action. This kind of action is always available from the main grid if you're viewing an ItemType it's attached to. You can then check for the number of selected items in the grid with a code sample like below.
    var selectedItems = window.work.grid.GetSelectedItemIDs();
    if (selectedItems.length < 2) {
    return aras.AlertWarning("This action requires two or more items to be selected");
    }
    // Put actual method logic below here
    Chris
    Christopher Gillis Aras Labs Software Engineer
Children
No Data