Data Buffer in Stored Calc is not working during Condolidation
Hi All - I am trying to copy Base accounts from Actual to Plan Scenario but it is not working when I try to consolidate but it is working when I perform force consolidate. Below is the code and any help would be appreciated.
If ((Not api.Entity.HasChildren()) And (api.Cons.IsLocalCurrencyforEntity())) Then
If api.Pov.Scenario.Name = "Plan" Then
api.Data.Calculate("S#Plan = Eval(S#Actual:O#Top:I#Top:U1#Total_CostCenter:U2#Total_ProfitCenter)","A#[Corp_US_Sales].Base",,,,,,,,,,,,AddressOf OnEvalDataBufferScrFilter)
Brapi.ErrorLog.LogMessage(si,"APIDATA")
End If
End If
Private Sub OnEvalDataBufferScrFilter(ByVal api As FinanceRulesApi, ByVal evalName As String, ByVal eventArgs As EvalDataBufferEventArgs)
Try
eventArgs.DataBufferResult.DataBufferCells.Clear()
For Each sourceCell As DataBufferCell In eventArgs.DataBuffer1.DataBufferCells.Values
'Only process cells that have data
If (Not sourceCell.CellStatus.IsNoData) Then
'Apply filtered source cells with data as the new Data Buffer Cells
Dim resultCell As New DataBufferCell(sourceCell)
'Set cells for Data Buffer
eventArgs.DataBufferResult.SetCell(api.SI,resultCell,False)
End If
Next
Catch es As Exception
Throw ErrorHandler.LogWrite(api.SI, New XFException(api.SI,es))
End Try
End Sub
Thanks
