You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: powerapps-docs/maker/model-driven-apps/optimize-form-performance.md
+13-11Lines changed: 13 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,10 +8,6 @@ ms.service: powerapps
8
8
ms.suite: ""
9
9
ms.tgt_pltfrm: ""
10
10
ms.topic: "article"
11
-
applies_to:
12
-
- "Dynamics 365 (online)"
13
-
- "Dynamics 365 Version 9.x"
14
-
- "powerapps"
15
11
author: "Mattp123"
16
12
ms.assetid: 59cfa5e6-638a-437f-a462-fddfd26fb07d
17
13
caps.latest.revision: 8
@@ -41,24 +37,30 @@ Forms that load slowly can reduce productivity and user adoption. Follow these r
41
37
## Form scripts
42
38
When you have customizations using form scripts make sure that the developer understands these strategies to improve performance.
43
39
44
-
**Avoid including unnecessary JavaScript web resource libraries**
45
-
The more scripts you add to the form, the more time it will take to download them. Usually scripts are cached in your browser after they are loaded the first time, but the performance the first time a form is viewed often creates a significant impression.
40
+
**Avoid using synchronous requests**
41
+
Synchronous requests can cause slow page loads and unresponsive forms. [Use asynchronous requests instead](https://docs.microsoft.com/powerapps/developer/model-driven-apps/best-practices/business-logic/interact-http-https-resources-asynchronously). See [this blog post](https://powerapps.microsoft.com/en-us/blog/turbocharge-your-model-driven-apps-by-transitioning-away-from-synchronous-requests/) for more examples.
46
42
47
-
**Avoid loading all scripts in the Onload event**
48
-
If you have code that only supports `OnChange` events for fields or the `OnSave` event, make sure to set the script library with the event handler for those events instead of the `OnLoad` event. This way loading those libraries can be deferred and increase performance when the form loads.
43
+
**Avoid including unnecessary JavaScript web resource libraries**
44
+
The more scripts you add to the form, the more time it will take to download them. Usually scripts are cached in your browser after they are loaded the first time, but the performance the first time a form is viewed often creates a significant impression.
45
+
46
+
**Avoid loading all scripts in the Onload event**
47
+
If you have code that only supports `OnChange` events for fields or the `OnSave` event, make sure to set the script library with the event handler for those events instead of the `OnLoad` event. This way loading those libraries can be deferred and increase performance when the form loads.
49
48
50
49
**Use collapsed tabs to defer loading web resources**
51
50
When web resources or IFRAMES are included in sections inside a collapsed tab they will not be loaded if the tab is collapsed. They will be loaded when the tab is expanded. When the tab state changes the `TabStateChange` event occurs. Any code that is required to support web resources or IFRAMEs within collapsed tabs can use event handlers for the **TabStateChange** event and reduce code that might otherwise have to occur in the `OnLoad` event.
52
51
53
-
**Set default visibility options**
54
-
Avoid using form scripts in the `OnLoad` event that hide form elements. Instead set the default visibility options for form elements that might be hidden to not be visible by default when the form loads. Then, use scripts in the `OnLoad` event to show those form elements you want to display.
52
+
**Set default visibility options**
53
+
Avoid using form scripts in the `OnLoad` event that hide form elements. Instead set the default visibility options for form elements that might be hidden to not be visible by default when the form loads. Then, use scripts in the `OnLoad` event to show those form elements you want to display.
55
54
56
55
<aname="BKMK_CommandBar"></a>
57
56
## Command bar or ribbon
58
57
Keep these recommendations in mind as you edit the command bar or ribbon.
59
58
60
59
**Keep the number of controls to a minimum**
61
-
Within the command bar or the ribbon for the form, evaluate what controls are necessary and hide any that you don’t need. Every control that is displayed increases resources that need to be downloaded to the browser.
60
+
Within the command bar or the ribbon for the form, evaluate what controls are necessary and hide any that you don’t need. Every control that is displayed increases resources that need to be downloaded to the browser.
61
+
62
+
**Use asynchronous network requests in Custom Rules**
63
+
When using custom rules that make network requests in Unified Interface, [use asynchronous rule evaluation](https://docs.microsoft.com/powerapps/developer/model-driven-apps/define-ribbon-enable-rules#custom-rule).
0 commit comments