Scope: managed applications.
Avoid lengthy execution of the client code, except for time-consuming server code calls made from the client code (see "Time-consuming operations on the server") as it significantly slows down the application performance. Avoid executing potentially time-consuming operations (such as accessing network resources, processing complex data algorithms on the client) in idle and event handlers of form items.
Time-consuming client operations can be executed only when users start them explicitly (for example, by clicking a button).
Example 1
Incorrect:
Access web service in an idle handler to get update details.
Correct:
Get update details only by clicking a button or get update details on the server:
-
Get update details in a scheduled job through a web service and save this data, for example, to the register.
-
Read received update details in an idle handler by sending a simple query to the register.
Example 2
Incorrect:
Check for network resource availability in the OnChange event handler of the form field. A path to this network resource is entered in this field.
Correct:
Check for network resource availability in a handler of the interface command displayed, for example, as the Check button.