Run Action from Relationship

I have an Itemtype A and a relationship to Itemtype B

On the Main grid of ItemType B I have an action which works perfectly fine

On Itemtype A in the relationship Grid where there is ItemType B if i place my action there It does not work. I was wondering if there is a short cut way or maybe use applymethod() and if i can use applymethod() can you tell me how can i pass an ID that it triggers it,

Parents
  • I'm not sure of what ID you want to pass but if you want to get the Item type B, item ID you can use below code

    var wnd = aras.getMainWindow();
    var topWnd = aras.getMostTopWindowWithAras(window);
    wnd = wnd === topWnd ? wnd.main : topWnd;
    var selectedIds;
    if (wnd.parent.main) //For Main Grid
    {
    selectedIds = wnd.parent.main.work.grid.getSelectedItemIds();
    }
    else  // For Relationship Grid
    {
    selectedIds = [wnd.itemID];
    }

    Thanks

    Gobikrishnan R

Reply
  • I'm not sure of what ID you want to pass but if you want to get the Item type B, item ID you can use below code

    var wnd = aras.getMainWindow();
    var topWnd = aras.getMostTopWindowWithAras(window);
    wnd = wnd === topWnd ? wnd.main : topWnd;
    var selectedIds;
    if (wnd.parent.main) //For Main Grid
    {
    selectedIds = wnd.parent.main.work.grid.getSelectedItemIds();
    }
    else  // For Relationship Grid
    {
    selectedIds = [wnd.itemID];
    }

    Thanks

    Gobikrishnan R

Children
No Data