Enter Text Value from dashboard and read in BR

Omkareshwar
Contributor II

Hi 

 

I want to read a text value from dashboard in finance business rule.

I tried attaching a parameter to text box component and then read that parameter in the code but that is not working.

 

Thanks,

Omkareshwar

 

 

Thanks, Omkareshwar
Archetype Consulting
1 ACCEPTED SOLUTION

Michel_Sabourin
Contributor II

I've done this with the JournalsEventHandler, because there's no native place to store a reject reason and pas sit to the email notification. The dashboard I created has a text box bound to a literal value parameter. It also has a button that takes the text box value and updates the parameter using a Solution Helper in a Dashboard Extender rule.

If (args.FunctionName.XFEqualsIgnoreCase("Set_Reject_Reason")) Then
    Dim setReason As String = args.NameValuePairs.XFGetValue("Reason")
    BRApi.Dashboards.Parameters.SetLiteralParameterValue(si, False, "SU_PAram_LV_Reject_Reason", setReason)
End If

The extensibility rule then picks up this value using the following code:

Dim RejectReason As String = BRApi.Dashboards.Parameters.GetLiteralParameterValue( _
    dbConnApp.SI, False, "SU_PAram_LV_Reject_Reason")

 

View solution in original post

2 REPLIES 2

ChrisLoran
Valued Contributor

A finance business rule that runs a standard calculate should never rely on values from dashboard components, because the calculate operation could be triggered from places other than the dashboard, such as Data Mgmt steps, Cube Views, APIs.

However if you are talking about a *custom* finance rule that uses the event FinanceFunctionType.CustomCalculate , then you would normally trigger this directly from a dashboard button , and pass the text value as an argument to that CustomCalculate.

This is documented in the Design & Reference Guide in the chapter "Presenting Data with Books, Cube Views and Other Items", under the heading "Finance Custom Calculate Business Rule Example":

Your dashboard button that executes the custom business rule would have the Selection Changed Server Task set to something like this: {Business Rule Name}{Function Name}{Optional Name-Value Pairs}


and the action set to [Finance Custom Calculate Business Rule], not [Calculate].  There is also an example of how to use the CustomCalculateArgs.

For any help on this topic you will need to be much more specific:

- What is the dashboard parameter type, is it Input Value ?
-  Is the dashboard parameter bound to the Text Input component?
- What exactly is invoking the calculate business rule?  Is it a cube-calculate (i.e. standard calculate, not recommended), or a custom calculate action that is triggered from a dashboard button (recommended).
- What are the arguments you are passing through to your calculate, if you are using a button to trigger the calculate?

It would be much more challenging (and strongly discouraged) to feed a dashboard parameter through to the DUCS (Data Unit Calculation Sequence), if that is what you are doing.

 

Michel_Sabourin
Contributor II

I've done this with the JournalsEventHandler, because there's no native place to store a reject reason and pas sit to the email notification. The dashboard I created has a text box bound to a literal value parameter. It also has a button that takes the text box value and updates the parameter using a Solution Helper in a Dashboard Extender rule.

If (args.FunctionName.XFEqualsIgnoreCase("Set_Reject_Reason")) Then
    Dim setReason As String = args.NameValuePairs.XFGetValue("Reason")
    BRApi.Dashboards.Parameters.SetLiteralParameterValue(si, False, "SU_PAram_LV_Reject_Reason", setReason)
End If

The extensibility rule then picks up this value using the following code:

Dim RejectReason As String = BRApi.Dashboards.Parameters.GetLiteralParameterValue( _
    dbConnApp.SI, False, "SU_PAram_LV_Reject_Reason")