Applicable Versions: 4.05.0000 and above


When a query is refreshed in the dashboard, the DashboardDesigner control checks if there is a valid control panel object for each required field in the query. For each required field that does not have a valid control panel object, the DashboardDesigner fires an event to try and retrieve the query parameter value from the calling application.
Thus, to provide query parameter values from the third party application rather than from a control on the dashboard, follow these steps (each step is described in more detail later in the article):


1. Delete the control panel objects that provide query parameter values from the dashboard.
2. Provide code in your application to respond to the RequiredFieldValueRequest event to provide the parameter value for the query.


For an example of using this technique in the AppBuilder to refresh a dashboard based on the value selected in another dashboard, please see the drill down example.


Deleting Control Panel Objects
Follow these steps to remove control panel objects that provide query parameter values from the dashboard.


1. Open the dashboard in the DataPA Enterprise Dashboard application.
2. Double click on the control panel in the dashboard to open the Control Panel dialog box.
3. Select the control panel object in the control panel.
4. Select the Delete button in the ribbon.
5. Press OK
6. Save the dashboard.


The RequiredFieldValueRequest Event in the AppBuilder
The RequiredFieldValueRequest event is raised by the DashboardDesigner control for each required field of a query that does not have a related control panel object when that query is run. It provides the developer with an opportunity to provide values for the required field.


Syntax for RequiredFieldValueRequest handler procedure


The syntax for responding to this event in the ManagedDashboard control from the AppBuilder is:

PROCEDURE COMhdl-expression.RequiredFieldValueRequest .
DEFINE INPUT PARAMETER p-sender AS COM-HANDLE NO-UNDO.
DEFINE INPUT PARAMETER p-e AS COM-HANDLE NO-UNDO.
[Code]
END PROCEDURE.


COMhdl-expression
Is an expression that returns a component handle of a realised DashboardDesigner instance.


p-sender
Receives a handle to the DashboardDesigner that has raised the event.


p-e
Receives a handle to a RequiredFieldValueRequestEventArgs object that provides the interface to interact with the event.


Code
The code to respond to the event.


For example, the following code responds to the RequiredFieldValueRequest by applying United Kingdom to the country parameter :


PROCEDURE CtrlFrame.DashboardDesigner.RequiredFieldValueRequest .
DEFINE INPUT PARAMETER p-sender AS COM-HANDLE NO-UNDO.
DEFINE INPUT PARAMETER p-e AS COM-HANDLE NO-UNDO.
IF p-e:RequiredField:Name = ""sports2000.Customer.Country"" THEN DO:
p-e:COMValue = ""United Kingdom"".
END.
END PROCEDURE.


The RequiredFieldValueRequest Event in the Visual Studio
The RequiredFieldValueRequest event is raised by the DashboardDesigner control for each required field of a query that does not have a related control panel object when that query is run. It provides the developer with an opportunity to provide values for the required field.


Syntax for RequiredFieldValueRequest handler procedure


The syntax for responding to this event in the ManagedDashboard control from Visual Studio is:

Private Sub RequiredFieldValueRequestHandler(sender As Object, e As DataPAEnterpriseDashboard.RequiredFieldValueRequestEventArgs) Handles COMhdl-expression.RequiredFieldValueRequest
[Code]
End Sub


COMhdl-expression

Is an expression that returns a component handle of a realised DashboardDesigner instance.


sender
Receives a handle to the DashboardDesigner that has raised the event.


e
Receives a handle to a RequiredFieldValueRequestEventArgs object that provides the interface to interact with the event.


Code
The code to respond to the event.


For example, the following code responds to the RequiredFieldValueRequest by applying United Kingdom to the country parameter :


Private Sub DashboardDesigner_RequiredFieldValueRequest(sender As Object, e As DataPAEnterpriseDashboard.RequiredFieldValueRequestEventArgs) Handles DashboardDesigner.RequiredFieldValueRequest
  If e.RequiredField.Name = ""sports2000.Customer.Country"" Then
    e.Value = ""United Kingdom""
  End If
End Sub


The RequiredFieldValueRequest Event in the Architect
The RequiredFieldValueRequest event is raised by the DashboardDesigner control for each required field of a query that does not have a related control panel object when that query is run. It provides the developer with an opportunity to provide values for the required field.


Syntax for RequiredFieldValueRequest handler procedure


The syntax for responding to this event in the ManagedDashboard control from Architect is:

METHOD PRIVATE VOID QueryParamHandler( INPUT sender AS System.Object, INPUT e AS DataPAEnterpriseDashboard.RequiredFieldValueRequestEventArgs ):
[Code]
END METHOD.


sender

Receives a handle to the DashboardDesigner that has raised the event.


e
Receives a handle to a RequiredFieldValueRequestEventArgs object that provides the interface to interact with the event.


Code
The code to respond to the event.


For example, the following code responds to the RequiredFieldValueRequest by applying United Kingdom to the country parameter :


METHOD PRIVATE VOID QueryParamHandler( INPUT sender AS System.Object, INPUT e AS DataPAEnterpriseDashboard.RequiredFieldValueRequestEventArgs ):
  IF e:RequiredField:Name = ""sports2000.Customer.Country"" THEN DO:
    e:Value = ""United Kingdom"".
  END.
  RETURN.
END METHOD.