Data Buffer to delete the data on the LHS (Target Account) ?????
All - Could you please review code is make sense from performance. I am trying to be checking the target Account is <> 0 then it will delete the source value and overwrite the target value. PLease review and let me know if I can use some kind of EVAl or Data Buffer???
If Not api.Entity.HasChildren Then
If Not api.Cons.IsLocalCurrencyForEntity Then
api.Data.Calculate("A#Target:F#EndBalInput=RemoveZeros(Eval(A#Source))",AddressOf OnEvalDataBuffer)
End If
End If
Private Sub OnEvalDataBuffer(ByVal api As FinanceRulesApi, ByVal evalName As String, ByVal eventArgs As EvalDataBufferEventArgs)
eventArgs.DataBufferResult.DataBufferCells.Clear
If Not eventArgs.DataBuffer1 Is Nothing Then
For Each Cell As DataBufferCell In EventArgs.DataBuffer1.DataBufferCells.Values
If Cell.CellAmount <> 0 Then
'api.LogMessage(cell.CellAmount.ToString)
api.Data.ClearCalculatedData(True,True,True,"A#Target")
eventargs.DataBufferResult.SetCell(api.SI,cell)
' Else
' api.LogMessage("NODATA")
End If
Next
End If
End Sub
