You might also experiment with global variables inserted as merge text on your layout. This approach avoids defining any field for display purposes.
It can be a bit tricky, but you can even use a let function inside a conditional format expression to assign a value to such a variable.
I tend to stay away from these because they are less "tracable"
However a design reference table in the app help system might suffice in this case. What are some of the limitations. I know I need to setup the global variables via a script step, so is this best at statup?
Sometimes you don't even need the script step.
Say you give a layout object this conditional format expression:
Let ($$Total = Sum ( Relatedtable::Field ) ; True )
$$Total is then given a value without any script being used.
Some Developers add the Layout text: "I declare variables", then use a conditional format expression to assign values to the global variables with such a use of the let function. The format applied is one to render the text invisible when not in layout mode so the user does not see this text.
This way, the layout itself declares the variables. I'm not totally sold on this trick BTW, it can be tricky sometimes to get the variable to update correctly and the "side effect programming" style this requires isn't something I like doing as a general rule.