SNTT: Opening subforms quickly
Posted by therightnotes on April 19, 2007
This is a tip that has been around awhile, but it is so unbelievable that I wanted to share it in case you haven’t seen it. In other words, this doesn’t originate with me, and I’ve forgotten where I found it originally.
As most of you know, subforms are slow. A form with multiple subforms is particularly slow, even if the subforms aren’t computed (which, of course, slows the loading of the form further). There is one easy way to make subforms load quickly: Put some lotusscript code–Any Code!–in the initialize event of every subform. We use something like this:
Dim fastOpen as boolean
fastOpen = True
If you have a form with multiple subform, this simple, meaningless code that does nothing makes a HUGE difference in load time. I have no idea why adding code makes the subforms load faster, but it does (at least in Notes 5 and 6). Give it a try!
Chris Blatnick said
Excellent! I seem to remember seeing this somewhere a long time ago, but did forget about it completely. Thanks for the reminder!!!
Thomas Adrian said
Great tip, do you have any idea if subforms on web load faster as well.
Thomas
http://www.notessidan.se
therightnotes said
Thomas, I don’t know for certain how it effects web performance. I hadn’t noticed the extreme slowness on the web the way I had in the client. Let me know if you test it out and determine whether or not it works for the web!
Gerry King said
>even if the subforms aren’t computed (which, of course, slows the loading of the form further).
ISTR reading somewhere that computed subforms were quicker… unfortunately I can’t remember where. What is the best way of testing these non intutive approaches on the web?
Thomas Schulte said
Well what we found out that this is not a problem of code but one of compiling. So this solution solves this issue only temporary.
therightnotes said
Thomas, I’m not sure I follow…are you saying that the slowness of loading subforms returns over time?
Stephan H. Wissel said
This works depending on how your FORM looks like. We ran into this problem before and adding LotusScript to the subForms really speeds things up. What also works is to remove code from the Global section from the form and push it to the form level… of course that only works when you don’t need the variables/functions in button scripts. A very good idea instead of having functions and variables “hang around” is to pack them into a custom class as methods.
stw