Get the Context Action Name in the Method

Hi All, 

I have Multiple Server Side Item Actions Configured on the Part Item , I want the logic/functionality to be performed by each action to be controlled by the same method .

In which case , is there a way to pass the Invoking action name to the Method so that based on the value I can chose the function to be performed.

For the above action , I want to get the action name "plm_Test" while invoking the method on the Item.

This would greatly help me in avoiding creating Multiple Methods for each Action.

Thanks.

Parents
  • Hi ShrutiS,

    that´s a very good question! I myself searched two years for this one until I was able to find the most obvious solution:

    Innovator inn = this.getInnovator();
    return inn.newError("This call comes from " + this.getAction());

  • Hi Angela,

    Thanks for the response, for some response when I tried this.getAction() it returned the method name and not the Action name.

    I then switched to the CUI menu item and I am now able to get the resp menu button name in the inArgs parameter Slight smile

    Regards

  • CUI is the choice of the real professional!ThumbsupSlight smile

    Haven´t tried this one with CUI so far, so your inArgs hint is also useful for myself. Not sure if I was really right with my Action solution. I think I mixed it up with a different issue. I checked my Actions again -> in reality I used small Methods that call the main Method with "dummy" property to indicate the calling Action. Your CUI solution is more elegant.

Reply
  • CUI is the choice of the real professional!ThumbsupSlight smile

    Haven´t tried this one with CUI so far, so your inArgs hint is also useful for myself. Not sure if I was really right with my Action solution. I think I mixed it up with a different issue. I checked my Actions again -> in reality I used small Methods that call the main Method with "dummy" property to indicate the calling Action. Your CUI solution is more elegant.

Children
No Data