Hi benmac360
Are you just trying to hide derived data? If so, we use the following code to din a UD8 member to do so:
Dim cellStatus As DataCellStatus = api.Data.GetDataCell("U8#None").CellStatus
Dim account As Integer = api.Pov.Account.MemberId
Dim accounttype As String = api.Account.GetAccountType(account).ToString
Dim value As Decimal = api.Data.GetDataCell("U8#None").CellAmount
If cellStatus.IsAnnotationTypeViewMember Or cellStatus.IsDerivedData Then
Return Nothing
Else If value = Nothing Then
Return Nothing
Else
Return value
End If
Alternatively, you can just add the a check for cell status to your logic. See below:
Dim gbTimeName As String = BRApi.Workflow.General.GetGlobalTime(si)
Dim gbTimeID As Integer = BRApi.Finance.Time.GetIdFromName(si, gbTimeName)
Dim gbYear As Integer = BRApi.Finance.Time.GetYearFromId(si, gbTimeID)
'Get pov year
Dim pvYear As Integer = api.Time.GetYearFromId(api.Pov.Time.MemberId)
'Get global month
Dim objTimeMemberSubComponents As TimeMemberSubComponents = BRApi.Finance.Time.GetSubComponentsFromName(si, gbTimeName)
Dim gbMonthStr As String = objTimeMemberSubComponents.Month.ToString
Dim gbMonth As Integer = CInt(gbMonthStr)
'Get POV month
Dim pvTimeName As String = api.Pov.Time.MemberID
Dim pvobjTimeMemberSubComponents As TimeMemberSubComponents = BRApi.Finance.Time.GetSubComponentsFromName(si, pvTimeName)
Dim pvMonthStr As String = pvobjTimeMemberSubComponents.Month.ToString
Dim pvMonth As Integer = CInt(pvMonthStr)
Dim gbTime As Integer = gbYear & gbMonth
Dim pvTime As Integer = pvYear & pvMonth
If pvTime < gbTime Then
Return api.Data.CreateDataCellObject(0.0, False, False)
Else If cellStatus.IsAnnotationTypeViewMember Or cellStatus.IsDerivedData Then
Return api.Data.CreateDataCellObject(0.0, False, False)
Else
Return api.Data.GetDataCell("U8#None").CellAmount
End If
Mark