Forum Discussion
JackLacava
2 years agoHonored Contributor
This sounds like "do my homework" eh 😏 I'd suggest starting with this old ppt... But here's some untested code to give you an idea for a possible technique.
' F#YourBalanceFlow is probably too generic, you should add as many other dimensions as you can
Dim BadAccounts as new List(Of Integer)
Dim dbuf As DataBuffer = api.Data.GetDataBufferUsingFormula( _
"FilterMembers(F#YourBalanceFlow, A#Account1, A#Account2, A#Account3)") ' etc etc, or use expansions
For Each myCell As DataCell In dbuf.DataBufferCells.Values
If Not BadAccounts.Contains(myCell.DataCellPk.AccountId) Then
If myCell.CellAmount <> 0 Then
BadAccounts.Add(myCell.DataCellPk.AccountId)
End If
End If
Next
If BadAccounts.Count > 0 Then
Dim message As String = $"The following accounts failed validation: {VbCrLf}"
For Each accountId As Integer In BadAccounts
' turn that ID into a readable account name
message &= api.Members.GetMemberName(dimtype.Account.Id, accountId) & $" {VbCrLf}"
Next
args.ConfirmationRuleArgs.Info1 = message
Return False
End If
args.ConfirmationRuleArgs.Info1 = "All good, surf up dude"
Return True
Related Content
- 11 months ago
- 8 months ago
- 10 months ago