Forum Discussion

team_aras_meupe_com's avatar
3 years ago

Calling Action from a grid or a form. May I know where I call from?.

Hello, I have a question, I have an "Action" which I can call either from the menu, the grid, or from the form. Is there any way to know from where I call that "Action"?. I need to differentiate it to execute one part of the code or another.

Too many thanks!!!!

3 Replies

  • Hi,

    this post collects some variants: https://community.aras.com/f/development/3996/call-same-client-method-from-different-locations-action-cui-form-button

    But I still discover new ones, cause the new CUI interface offers a lot of ways to deal with items and elements.

    This variant can be used for Form and Actions. This combination would only allow JS:

    let myItem;
    if (parent.thisItem === undefined){
        myItem = this; // Action call
    }
    else 
    {
        myItem = parent.thisItem; // form call
    }
    
    return aras.AlertError(myItem.getProperty("name"));



    • team_aras_meupe_com's avatar
      team_aras_meupe_com
      Creator III

      Thank you very much Angela, I will read everything and try.

      One question, is there any help where I can see all the methods, etc, that exist in ARAS? I have 3 PDFs, but it is not complete.
      For example of aras.uiReShowItem I have not found anything in any PDF, only in the forum.

      Thank you very much!!.

      • angela's avatar
        angela
        Catalyst II

        Hahaha! These funny questions of new users.[emoticon:98f842990f454422aa6a04953955f9d9]

        Unfortunately JavaScript related function often is not documented at all. But don´t worry to much about it. 

        The forum is an excellent source for stuff not covered in the official docs. As additional useful resource I can recommend the "aras programmers guide". It contains a lot of useful samples. You can google it.

        There are API references inside Innovator and some are also listed here: https://cylnote.blogspot.com/search/label/API%20Reference