victortei
2 months agoNew Contributor III
Is it possible to setData using SaveDataEventHandler?
Hi everyone,
We’ve been using the SaveDataEventHandler to prevent users from submitting zero values for a specific scenario and flow.
While the error message works perfectly in the Cube Views, we’ve encountered an issue when users try to submit a zero from Excel—no error message is displayed. From what I’ve read, error messages don’t work in Excel.
As a workaround, we’re considering a different approach: instead of throwing an error when a zero is submitted, we would save the zero as NotStored (dataCellStorageType.NotStored) and NoData (dataCellExistenceType.NoData). However, despite our efforts, we can’t get SaveData to function as expected. Has anyone encountered this issue or have any ideas?
Dim ScenarioName As String = "Actual"Dim FlowMember As String = "USDOverrideEndBal"If args.NewDataCell.DataCellPK.ScenarioId = BRApi.Finance.Members.GetMemberId(si, dimtype.Scenario.Id, ScenarioName) ThenIf args.NewDataCell.DataCellPK.FlowId = BRApi.Finance.Members.GetMemberId(si, dimtype.Flow.Id, FlowMember) ThenIf args.NewDataCell.DataCellPK.OriginId = DimConstants.Forms Then'Check if it's Real DataIf args.NewDataCell.CellStatus.IsRealData Then'Check if it's a hard zeroIf args.NewDataCell.CellAmount = 0 ThenDim NewNumber As Decimal = 0args.NewDataCell.SetData(NewNumber, dataCellExistenceType.NoData, dataCellStorageType.NotStored)End IfEnd IfEnd IfEnd IfEnd IfReturn args
Thanks,
Victor