You would do something like this into a Dashboard XFBR String :
If (args.FunctionName.XFEqualsIgnoreCase("GetFlowConstraints")) Then
' Return Me.GetFlowConstraints(si, globals, api, args)\
And then the formula could be :
Public Function GetFlowConstraints(ByVal si As SessionInfo, ByVal globals As BRGlobals, ByVal api As Object, ByVal args As DashboardStringFunctionArgs) As String
Try
'Get the Dim PK for Accounts Dimension
Dim AccountsDimPk As DimPk = BRApi.Finance.Dim.GetDimPk(si,"DIMAccount")
'Get the member name of the account
'Get a list of BS accounts
Dim memFilterAccounts As List(Of MemberInfo) = BRAPi.Finance.Members.GetMembersUsingFilter(si, AccountsDimPk, "A#BS.Base.Where(InUse = True)", True)
'Use a text builder to build a string
Dim acMemberList As New Text.Stringbuilder()
' Dim isfirstItem As Boolean = True
'Loop through the assigned accounts and return the first account in the list
For Each account As MemberInfo In memFilterAccounts
' If Not isfirstItem Then
Dim accountConstraints As String = BRApi.Finance.Account.GetConstraintMemberForDimType(si,account.Member.MemberId,dimTypeid.Flow,-1).ToString
Dim selectedConstraint As String = args.NameValuePairs.XFGetValue("FlowTable").ToString
If accountConstraints = selectedConstraint Then
' Else
acMemberList.Append("A#")
acMemberList.Append(account.Member.Name)
' End If
' isfirstItem = False
End If
Next
'log
'Brapi.errorlog.LogMessage(si,acMemberList.ToString)
Return acMemberList.ToString
Catch ex As Exception
Throw ErrorHandler.LogWrite(si, New XFException(si, ex))
End Try
End Function
tbh i have not tested 🙂
And you can read that too : https://community.onestreamsoftware.com/t5/Accepted-Code-Samples/Dashboard-XFBR-String/ta-p/6611