Forum Discussion
Hi Kashinath,
I wouldn't recommend the approach that you've taken given the information you've provided. Your rule is more complex than necessary. The code also contains a few items that we recommend doing your best to avoid when writing a rule: not constraining the code to base entities and C#Local, looping through a list, using BRapi instead of the available api and writing an api.data.calculate statement inside of the loop.
An easier way to accomplish the display of signage in reports and cube views is to use a dynamic UD8 member that will display the book signage based on the account type. There is an example of this below - it's far better than doubling up your revenue (and possibly liability/equity) data in the database.
To address the issue of clearing of data, it's a property on the Scenario, Clear Calculated Data During Calc, which is recommended to be set to TRUE in most cases. It sounds as though there may be an issue with where this rule is triggered during your process.
'This UD member is for reporting purposes.
'It flips the sign back to natural sign based on the account type
Dim acct As String = api.Pov.Account.Name
Dim acctTypeName As String = api.Account.GetAccountType(api.Pov.Account.MemberId).Name
If (Not acct Is Nothing) Then
If acctTypeName.XFEqualsIgnoreCase("Liability") Or _
acctTypeName.XFEqualsIgnoreCase("Revenue") Then
Return api.Data.GetDataCell("A#" + acct + ":U8#None * -1")
Else
Return api.Data.GetDataCell("A#" + acct + ":U8#None")
End If
End If
Return Nothing
Related Content
- 6 months ago
- 11 months ago
- 8 months ago
- 10 months ago