FlowField and SumIndexField functions

In Chapter 3, Data Types and Fields, we discussed SumIndexFields and FlowFields in the context of table, field, and key definition. To recap briefly, SumIndexFields are defined in the screen where the table keys are defined. They allow very rapid calculation of values in filtered data. In most ERP and accounting software systems, the calculation of group totals, periodic totals, and such require time-consuming processing of all the data to be totaled.

SIFT allows a NAV system to respond almost instantly with totals in any area where the SumIndexField was defined and is maintained. In fact, use of SIFT totals combined with NAV's retention of detailed data supports totally flexible ad hoc queries of the form "What were our sales for red widgets between the dates of November 15th through December 24th?" And the answer is returned almost instantly! SumIndexFields are the basis of FlowFields that have a Method of Sum or Average; such a FlowField must refer to a data element that is defined as a SumIndexField.

When we access a record that has a SumIndexField defined, there is no visible evidence of the data sum that SumIndexField represents. When we access a record that contains FlowFields, the FlowFields are empty virtual data elements until they are calculated. When a FlowField is displayed in a page or report, it is automatically calculated by NAV; the developer doesn't need to do so. However, in any other scenario, the developer is responsible for calculating FlowFields using the CALCFIELDS function.

FlowFields are one of the key areas where NAV systems are subject to significant processing bottlenecks. Even with the improved NAV 2017 design, it is still critical that the Table Keys used for SumIndexField definition are designed with efficient processing in mind. Sometimes, as part of a performance tuning effort, it's necessary to revise existing keys or add new keys to improve FlowField performance.

Note that even though we can manage indexes in SQL Server independent of the NAV key definitions, having two different definitions of keys for a single table may make our system more difficult to support in the long run because the SQL Server resident changes aren't always readily visible to the NAV developer.

In addition to being careful about the SIFT-key structure design, it is also important not to define any SumIndexFields that are not necessary. Each additional SumIndexField adds additional processing requirements, and thus adds to the processing load of the system.

Including SumIndexFields in a List page display is almost always a bad idea, because each SumIndexField instance must be calculated as it is displayed. Applicable functions include CALCFIELDS, CALCSUMS and SETAUTOCALCFIELDS.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.149.27.72