How to Deal with FlowFields
The calculation of FlowFields takes a lot of time in Microsoft Dynamics NAV 2009R2, so you cannot update all FlowFields every time you synchronize. It is also not recommended to run RECALCFIELDS after each posting routine. This would result in a long synchronization process which is not good for the user experience. There are other options available for FlowFields.
Nightly Recalculation of FlowFields
We recommend to create a new, normal field in your Microsoft Dynamics NAV 2009R2 table that stores the value you want to send to the user. In a nightly task you recalculate the FlowField. If the value has changed, update your new field and do a ”MODIFY”. This sigificantly reduces data traffic.
Use of an Online Fields
You may also use online fields Online Fields to display the value of FlowField. The field value will be automatically updated in the app independent of synchronization. Read more about Online Fields and how to set them up here.
Request a Recalculation
Sometimes it is required to have live data available. In this case, you can request a resend of FlowField data. Of course, an online connection is required to do so. First step is to provide a button in your user interface with an Action Code that marks your FlowField. A synchronization will be started immediately.
Next time you synchronize, you can do the recalulation in codeunit ACF App Events.
CASE RecRef.NUMBER OF
// Other code here ...
IF (DeviceFldRef.NUMBER = DeviceItem.FIELDNO(Inventory)) THEN BEGIN
//Recalculate FlowFields for this item
// Do not change the current value "Inventory"
NAVAction := NAVAction::Ignore;