While developing a Financial Reporting application for one of our customers, I came across the following behavior with respect to Rules that I wanted to highlight for the community.
For example purposes, let's pretend that the Rule has been built on an entity called "Report Lines" and is being used to calculate specific members (IE: Total Assets, Total Liabilities and Equity, etc) being displayed in DataViews on various reporting screens.
Whenever a new member was added to the "Report Lines" entity, I noticed (in the various reporting screens) that the Rule would "disappear" from the blocks upon which it had been applied.
(IE: Report Lines being calculated by the Rule would appear as expected/show calculated values --> New Member(s) added to Report Line Entity --> Report Lines being calculated by the Rule appear blank/show 0.)
There are 2 key considerations to account for when reproducing this "disappearing" rule behavior: the Sort By setting applied to the respective Entity and the position where the new member is added to the Entity relative to its existing members (IE: in between existing members vs at the end of member list).
When considering the Sort By setting applied to the respective Entity, it is important to remember that sorting in Board (for Entity members) is always done in ascending order. This means that the Sort By setting will dictate the positioning of the new member being added relative to the Entity's existing members.
In terms of the new member's position relative to existing members, Board will only produce the behavior in question when a new member is added either in between existing members or at the beginning of the Entity member list. Please refer to the below example in which Item 7 and Item 37 are the new members being added.
Further, this behavior will not occur if the new member is added at the end of the Entity member list. Please refer to the below example in which Item 47 is the new member being added.
Finally, I noticed that the only way to fix this "issue" was to open the Rules tab in Database, click the Save icon on the Rules tab, and Refresh the respective reporting screens displaying the Rule's calculated values. Once the Rules were saved and the screens had been refreshed, the Report Lines being calculated by the Rule would again appear as expected/show calculated values.
My initial (incorrect) thought was that this was an error/bug in the system, when in fact, this is considered to be standard/expected behavior with respect to Entities and Rules in Board.
In order to understand this behavior, we must consider the process of adding entity members from 2 perspectives: the end user and the Board platform itself.
From the end user's perspective this process involves assigning codes and descriptions to the members and creating a Rule based on the assigned codes.
From the Board platform's perspective, this involves assigning internal codes (index) to the members in ascending order as dictated by the respective Entity's Sort By setting. Whenever a new member is added to an Entity, the Rule will continue to reference the indexing that existed before the new member was added causing calculated lines which once displayed data to appear as blank/0.
The only way the Rule can be updated to reference the new indexing (assigned after the new member was added) is by performing the following actions:
- Open the Rules tab in Database
- Click the Save icon on the Rules tab
- Refresh the respective screens displaying the Rule's calculated values.