Forum Discussion
RobbSalzmann
2 years agoValued Contributor II
This is tested in an XFBR rule. Update accountDimName to your account dimension.
Dim accountDimName As String = "CorpAccounts"
Dim mFilter As String = "A#Root.Descendants"
'get all accounts
Dim lstAccounts As List(Of MemberInfo) = BRApi.Finance.Metadata.GetMembersUsingFilter(si, accountDimName, mFilter, False)
'filter on revenue accounts
Dim lstRevenueAccounts As List(Of MemberInfo) = lstAccounts.Where(Function(x) BRApi.Finance.Account.GetAccountType(si, x.Member.MemberId).Equals(AccountType.Revenue)).ToList()
' show the Revenue Accounts in the log
Dim revAccounts as String = String.Join(Environment.NewLine, lstRevenueAccounts .Select(Function(x) x.Member.Name))
BRApi.ErrorLog.LogMessage(si, $"Accounts: {revAccounts}")
Related Content
- 4 years ago
- 4 years ago