Forum Discussion

MarcusH's avatar
MarcusH
Contributor III
2 years ago

Accessing XFStrings through Business Rules

Does anyone know if it's possible to access XFStrings through Business Rules? We are adding other languages to our application and we are using XFStrings for Cube Views and Dashboards. We want to pre...
  • MarcusH's avatar
    MarcusH
    2 years ago

    Hi hiren

    I needed to change your code a little bit but I have got it working. And you only need one Dashboard parameter. I changed the parameter default value from

    XFString(Dummy, Culture=|!Culture!|)

    to 

    XFString(|!XFstr!|, Culture=|!Culture!|)

    Then I changed the Rules to this :

    Dim params As New Dictionary(Of String, String) From {{"Culture", "fr-FR"}, {"XFStr", "str_Currency"}}
    
    Dim ParamDisplayInfo As DashboardParamDisplayInfo = BRApi.Dashboards.Parameters.GetParameterDisplayInfo(si, False, params, "Param_Dummy")
    brapi.ErrorLog.LogMessage(si, ParamDisplayInfo.DefaultValueAfterSubstitution)

     Note that there are only 4 params - GUID.empty is removed - and the parameter name does not take the dashboard name. This might be a difference in versions.

    So the Rules pass through the XFString name as well as the Culture code. Works beautifully. Thank you so much for your help.