docs.intersystems.com
InterSystems IRIS Data Platform 2019.2  /  Implementing InterSystems IRIS Business Intelligence  /  Defining Custom Actions  /  Defining the Behavior of Actions

InterSystems: The power behind what matters   
Search:  


Defining the Behavior of the Actions
To define the behavior of the actions, override the %OnDashboardAction() callback method of your KPI class. This method has the following signature:
classmethod %OnDashboardAction(pAction As %String, pContext As %ZEN.proxyObject) as %Status
The system executes this callback when a user invokes an action on a dashboard. pAction is the logical name of the action. pContext is an object that contains information about the currently selected scorecard row and that provides a way for the method to return commands to the dashboard; the next sections give the details.
A simple example is as follows:
ClassMethod %OnDashboardAction(pAction As %String, pContext As %ZEN.proxyObject) As %Status
{
 Set sc = $$$OK
 Try {
      If (pAction = "Action 1") {
              //this part defines Action 1
              //perform server-side actions
          }
         Elseif (pAction="Action 2")
         {
                //this part defines Action 2
                //perform other server-side actions
                 }
        }
        Catch(ex) {
                Set sc = ex.AsStatus()
        }
 Quit sc
}
This method defines two actions, Action 1 and Action 2.
Note:
Because %OnDashboardAction() is a class method, you do not have access to %seriesNames or other properties of the KPI class from within this method (no class instance is available from the method).


Send us comments on this page
View this book as PDF   |  Download all PDFs
Copyright © 1997-2019 InterSystems Corporation, Cambridge, MA
Content Date/Time: 2019-09-19 05:42:26