mr_vodka Posted March 25, 2010 Posted March 25, 2010 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.
bruceR Posted March 29, 2010 Posted March 29, 2010 (edited) For that matter, couldn't you just use a conditional formatting calc attached to the object itself? No script required. Edited March 29, 2010 by Guest
mr_vodka Posted March 29, 2010 Author Posted March 29, 2010 (edited) Attaching it to the conditional formatting indeed sounds like an excellent idea although one would still have to accommodate for the initial setting of the variable to not see the annoying merge variable name. However, since I use multiple things such as row highlight as well, calling a script with the trigger is necessary for me anyway. *Edit - I just tested this and am not sure if it will work properly when its on the merge variable itself. However setting the let statement via conditional formatting on an object that is below it in the layout stack will force the update. Edited March 29, 2010 by Guest
bruceR Posted March 30, 2010 Posted March 30, 2010 (edited) I tested it briefly, directly on the merge variable, then looked at it more closely. You're right, there is a refresh issue. Put the conditional formatting on a header object, displayed the merge variable in the footer; no prob. Edited March 30, 2010 by Guest
Recommended Posts