[ Tip ] Insert Merge Variable
Just thought I would share this with others; especially those that have not played with merge variables yet ( dunno if it has been shared on other sites yet ).
With the implementation of layout level variables, they can be used as layout level calculations.
To address the refreshing of the data one could use an OnRecordLoad and call a script to refresh the data using Refresh Window .
However, this looks horrible with the flash particularly on Windows. A better way would just use a Freeze Window.
To refresh the layout merge variable values just call a script with a single Freeze Window step. Allow the setting of the variable to be set as a Script Parameter. Then you can reuse that generic script everywhere.
For example let's say that you wanted to update the record number of found count display
Well you can use OnRecordLoad, with a script parameter of:
Let( $$fndknt = Get ( RecordNumber ) & " of " & Get ( FoundCount ); "")
Call the generic script which only has the Freeze Window step in it.
On your layout, you should have the inserted Merge Variable $$fndknt on it. No more having to create a supplemental calc or use web viewer.