Article Original Creation Date: 2001-04-27
As mentioned, drawing the form is an expensive operation. If you display a form with all the segments open/fields visible, it will take longer to load than the same form where all the fields are hidden/segments are collapsed. By default, the Active Client displays only the first form segment open; all additional segments display in the collapsed format. This increases the speed that the form draws and therefore loads. In the CMS, each Active form is associated with a formscript, which traverses the form definition and opens certain additional segments. For the CMS, the top 6 segments that contain data are opened when the form (containing an exisiting record) is initially displayed. (There's a similiar rule for a new record). You can change this behaviour in script so that a lesser amount of segments are displayed open; this may increase performance, especially if the segments that are opened are secondaries with lots of records. Note that the same amount of data is remoted in this scenario, but it's just not displayed. When collapsed segments are opened, segments are drawn on demand, rather than up front.
Although it won't improve the performance of the form that is initially being displayed, caching of frequently used data should also be considered. If you have a business rule (e.g. that's triggered by a button click or changing a field) that relies on data that is static during the duration of the form and you expect this information to be used fairly often, it makes sense to cache that information rather than retrieving it every time it's needed (i.e. when the event fires). You can pass this data through the LoadFormData/NewFormData operation (via the parameterlist) and store the results in formscript variables for later use in the appropriate event hook script.
Problem
Best practices for speeding up loading Active forms.Solution
The simplest and most effective approach is to reduce the amount of data you're displaying on the form. The less that needs to be remoted from the middle tier to the client, and the less that needs to be rendered, the faster the forms will load. So, if you can simplify your forms, perhaps by having multiple forms (e.g. activated by clicking a button on a default form) rather than one large one, you will experience some improvement.As mentioned, drawing the form is an expensive operation. If you display a form with all the segments open/fields visible, it will take longer to load than the same form where all the fields are hidden/segments are collapsed. By default, the Active Client displays only the first form segment open; all additional segments display in the collapsed format. This increases the speed that the form draws and therefore loads. In the CMS, each Active form is associated with a formscript, which traverses the form definition and opens certain additional segments. For the CMS, the top 6 segments that contain data are opened when the form (containing an exisiting record) is initially displayed. (There's a similiar rule for a new record). You can change this behaviour in script so that a lesser amount of segments are displayed open; this may increase performance, especially if the segments that are opened are secondaries with lots of records. Note that the same amount of data is remoted in this scenario, but it's just not displayed. When collapsed segments are opened, segments are drawn on demand, rather than up front.
Although it won't improve the performance of the form that is initially being displayed, caching of frequently used data should also be considered. If you have a business rule (e.g. that's triggered by a button click or changing a field) that relies on data that is static during the duration of the form and you expect this information to be used fairly often, it makes sense to cache that information rather than retrieving it every time it's needed (i.e. when the event fires). You can pass this data through the LoadFormData/NewFormData operation (via the parameterlist) and store the results in formscript variables for later use in the appropriate event hook script.
Additional Info
Publish | 0 |
Knowledge_Base_Item_Id | 000000000000049B |
Edited | 0 |
Keywords | active client forms speed performance best practice |