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/developer/model-driven-apps/troubleshoot-forms.md
+19-19Lines changed: 19 additions & 19 deletions
Original file line number
Diff line number
Diff line change
@@ -25,7 +25,7 @@ This article helps you fix some common issues that you might encounter while wor
25
25
> [!IMPORTANT]
26
26
> - The workarounds described in this article are only designed for troubleshooting purposes; they aren't meant to be used in production scenarios.
27
27
> - These workarounds affect the current user session unless otherwise noted (for example, when a browser tab accesses the model-driven app). They don't change system customizations or affect any other users or sessions. After the current session is closed, the effect is no longer applied.
28
-
> - Most of the workarounds are available in most<!--note from editor: Suggested.--> production environments. Some of the workarounds mentioned in the guide might not have been deployed to your organization yet; new workarounds are added periodically.
28
+
> - Most of the workarounds are available in most production environments. Some of the workarounds mentioned in the guide might not have been deployed to your organization yet; new workarounds are added periodically.
29
29
> - The tools listed in this article can be used independently to troubleshoot different categories of issues.
30
30
31
31
## Use URL parameters to disable various form components
## View registered form event handlers and libraries in Monitor
66
-
<!--note from editor: The companion article to this one calls it simply "Monitor," so I'll do so in this article to be parallel. -->
66
+
67
67
To view registered form event handles and libraries, you can view the `FormEvents` operation in [Monitor](https://docs.microsoft.com/powerapps/maker/model-driven-apps/monitor-form-checker).
You'll need the `eventIndex` and `libraryIndex` parameter values when using the `DisableFormHandlers` or `DisableFormLibraries`<!--note from editor: In this article, these URL flags are sometimes bold, most often in code format. I can't see a reason for the difference, I think they should be consistent.--> URL flags. After an event or library is disabled, **disabledByConfigFlag** will be true and you'll also see such events in the actual event handling.
72
+
You'll need the `eventIndex` and `libraryIndex` parameter values when using the **DisableFormHandlers** or **DisableFormLibraries** URL flags. After an event or library is disabled, **disabledByConfigFlag** will be true and you'll also see such events in the actual event handling.
@@ -78,29 +78,29 @@ You'll need the `eventIndex` and `libraryIndex` parameter values when using the
78
78
79
79
When you're troubleshooting issues caused by form handlers, disable the form handlers by using the following URL flags:
80
80
81
-
-**&flags=DisableFormHandlers=\<event name\>**: Disables the form handlers by specifying the event name, for example, `DisableFormHandlers=OnLoad`. If you use the `DisableFormHandlers=true` flag, it disables the following event handlers: [OnLoad](https://docs.microsoft.com/powerapps/developer/model-driven-apps/clientapi/reference/events/form-onload), [OnSave](https://docs.microsoft.com/powerapps/developer/model-driven-apps/clientapi/reference/events/form-onsave), business rule, [OnChange](https://docs.microsoft.com/powerapps/developer/model-driven-apps/clientapi/reference/events/attribute-onchange), and [TabStateChange](https://docs.microsoft.com/powerapps/developer/model-driven-apps/clientapi/reference/events/tabstatechange).
81
+
-**&flags=DisableFormHandlers=\<event name\>**: Disables the form handlers by specifying the event name, for example, **DisableFormHandlers=OnLoad**. If you use the **DisableFormHandlers=true** flag, it disables the following event handlers: [OnLoad](https://docs.microsoft.com/powerapps/developer/model-driven-apps/clientapi/reference/events/form-onload), [OnSave](https://docs.microsoft.com/powerapps/developer/model-driven-apps/clientapi/reference/events/form-onsave), business rule, [OnChange](https://docs.microsoft.com/powerapps/developer/model-driven-apps/clientapi/reference/events/attribute-onchange), and [TabStateChange](https://docs.microsoft.com/powerapps/developer/model-driven-apps/clientapi/reference/events/tabstatechange).
82
82
83
-
-**&flags=DisableFormHandlers=\<event name\>_\<event index\>**: Disables the form handlers by specifying the event name and the event index value. For example, `DisableFormHandlers=true_0` disables the form handler at index 0. `DisableFormHandlers=onload_2` flag disables the form handler at index 2 of the [OnLoad](https://docs.microsoft.com/powerapps/developer/model-driven-apps/clientapi/reference/events/form-onload) event.
83
+
-**&flags=DisableFormHandlers=\<event name\>_\<event index\>**: Disables the form handlers by specifying the event name and the event index value. For example, **DisableFormHandlers=true_0** disables the form handler at index 0. **DisableFormHandlers=onload_2** flag disables the form handler at index 2 of the [OnLoad](https://docs.microsoft.com/powerapps/developer/model-driven-apps/clientapi/reference/events/form-onload) event.
84
84
85
-
-**&flags=DisableFormHandlers=\<event name\>\<starting index\>\<end index\>**: Disables all the form handlers by specifying the event name and the given index range. For example, `DisableFormHandlers=true_0_2` disables the form handlers at indexes from 0 through 2.<!--note from editor: I deleted "0 and 2 are included" because you don't need it if we go with this "from... through..." wording, which is how the Writing Style Guide recommends we write ranges of numbers. -->`DisableFormHandlers=onload_2_5` flag disables the [OnLoad](https://docs.microsoft.com/powerapps/developer/model-driven-apps/clientapi/reference/events/form-onload) handlers at indexes from 2 through 5.
85
+
-**&flags=DisableFormHandlers=\<event name\>\<starting index\>\<end index\>**: Disables all the form handlers by specifying the event name and the given index range. For example, **DisableFormHandlers=true_0_2** disables the form handlers at indexes from 0 through 2.**DisableFormHandlers=onload_2_5** flag disables the [OnLoad](https://docs.microsoft.com/powerapps/developer/model-driven-apps/clientapi/reference/events/form-onload) handlers at indexes from 2 through 5.
86
86
87
87
## Disabling form libraries
88
88
89
89
When you're troubleshooting issues caused by form libraries, disable the form libraries by using the following URL flags:
90
90
91
91
-**&flags=DisableFormLibraries=true**: Disables all form libraries.
92
92
93
-
-**&flags=DisableFormLibraries=\<library index\>**: Disables form libraries by specifying the library index value. For example, the `DisableFormLibraries=0` flag disables the form library at index 0.
93
+
-**&flags=DisableFormLibraries=\<library index\>**: Disables form libraries by specifying the library index value. For example, the **DisableFormLibraries=0** flag disables the form library at index 0.
94
94
95
-
-**&flags=DisableFormLibraries=\<starting index\>_\<ending index\>**: Disables the form libraries by specifying the library index range. For example, `DisableFormLibraries=0_2` flag disables the form libraries at indexes from 0 through 2.
95
+
-**&flags=DisableFormLibraries=\<starting index\>_\<ending index\>**: Disables the form libraries by specifying the library index range. For example, **DisableFormLibraries=0_2** flag disables the form libraries at indexes from 0 through 2.
96
96
97
97
### Difference between DisableFormHandlers and DisableFormLibraries
98
98
99
99
The main difference between disabling form libraries and form handlers are:
100
100
101
-
- The `DisableFormHandlers` flag disables form handlers regardless of the containing form libraries, whereas the `DisableFormLibraries` flag disables the form libraries (web resources) regardless of the functions (event handlers) included in the libraries.
101
+
- The **DisableFormHandlers** flag disables form handlers regardless of the containing form libraries, whereas the **DisableFormLibraries** flag disables the form libraries (web resources) regardless of the functions (event handlers) included in the libraries.
102
102
103
-
- The `DisableFormHandlers` flag doesn't prevent the containing form library from being loaded, thus it doesn't prevent the JavaScript code that's present in the library—but not registered as an event handler—from being executed. For example, if a form library `new_myscript.js` is written in the following way:<!--note from editor: Something is missing here.-->
103
+
- The **DisableFormHandlers** flag doesn't prevent the containing form library from being loaded, thus it doesn't prevent the JavaScript code that's present in the library—but not registered as an event handler—from being executed. For example, if a form library `new_myscript.js` is written in the following way:
104
104
105
105
- Assuming the `myOnloadHandler` is registered as an `OnLoad` event handler.
106
106
- The `DisableFormHandlers=true` flag only prevents the second alert, whereas the `DisableFormLibraries=true` flag prevents both alerts.
@@ -121,7 +121,7 @@ When you're troubleshooting issues caused by controls on a form, disable the con
121
121
**&flags=DisableFormControl=true**: Disables all the controls on a form.
122
122
123
123
> [!NOTE]
124
-
> `&flags=DisableFormControl=new_mycontrol` disables a specific control on the form. If the issue is resolved when the `&flags=DisableWebResourceControls=true` flag is used, there might be more than one web resource control on the form. You can use this flag to further identify the control that's causing the issue.
124
+
> **&flags=DisableFormControl=new_mycontrol** disables a specific control on the form. If the issue is resolved when the **&flags=DisableWebResourceControls=true** flag is used, there might be more than one web resource control on the form. You can use this flag to further identify the control that's causing the issue.
125
125
126
126
## Disable business process flows
127
127
@@ -139,7 +139,7 @@ Some common issues that can cause unexpected behavior when a model-driven app fo
139
139
140
140
These behaviors occur after the form is opened—for example, you see a value or control for a second, and then the value changes or the control disappears.
141
141
142
-
There are multiple reasons why unexpected behaviors occur when a form opens. One of the most common is the [OnLoad](https://docs.microsoft.com/powerapps/developer/model-driven-apps/clientapi/reference/events/form-onload) scripts that run synchronously or asynchronously to change the field or control behavior. To determine whether your script is causing the issue, you can disable the form handlers by appending `&flags=DisableFormHandlers=true`<!--note from editor: Edit okay? I assume you didn't want those asterisks in this string.--> at the end of your app URL.
142
+
There are multiple reasons why unexpected behaviors occur when a form opens. One of the most common is the [OnLoad](https://docs.microsoft.com/powerapps/developer/model-driven-apps/clientapi/reference/events/form-onload) scripts that run synchronously or asynchronously to change the field or control behavior. To determine whether your script is causing the issue, you can disable the form handlers by appending **&flags=DisableFormHandlers=true** at the end of your app URL.
143
143
144
144
If the form loads normally after you disable the form handler, there's an issue with the script that's blocking or causing an error when the form is loading.
145
145
@@ -155,7 +155,7 @@ The most common cause of intermittent or random form errors is using unsupported
155
155
156
156
-[formContext.getControl](https://docs.microsoft.com/powerapps/developer/model-driven-apps/clientapi/reference/controls/getcontrol) or [formContext.getControl(arg).getAttribute()](https://docs.microsoft.com/powerapps/developer/model-driven-apps/clientapi/reference/controls/getattribute) randomly returns null for a valid control or attribute.
157
157
158
-
There are many ways to write unsupported Client API methods, and they all share a common pattern: they cause a race condition in the form load pipeline. Because they introduce a race condition, the issue only occurs when the custom script is executed before the form is fully ready to be accessed via the Client API. This can depend on many factors:<!--note from editor: Edit okay? I didn't know what "depending on many factors" was modifying.-->
158
+
There are many ways to write unsupported Client API methods, and they all share a common pattern: they cause a race condition in the form load pipeline. Because they introduce a race condition, the issue only occurs when the custom script is executed before the form is fully ready to be accessed via the Client API. This can depend on many factors:
159
159
160
160
- In the JavaScript web resource, code is put into a global scope that's executed immediately when the web resource file is loaded, without waiting for the form to be accessible. Make sure the code is executed inside a valid form handler, such as an [OnLoad](https://docs.microsoft.com/powerapps/developer/model-driven-apps/clientapi/reference/events/form-onload) handler.
161
161
@@ -179,7 +179,7 @@ A typical cause for this error is the script that calls the `save()` method in t
179
179
180
180
**Resolution**:
181
181
182
-
In Monitor, the `FormEvents.onsave`<!--note from editor: Please note the change to plural "FormEvents" - edit okay? I'm going by the screenshot and the companion article about Monitor (for FormEvents.onsave and also FormEvents.onload).--> operation provides all the details that are causing the error. The form checker won't be able to detect the error if the issue can't be reproduced.
182
+
In Monitor, the `FormEvents.onsave` operation provides all the details that are causing the error. The form checker won't be able to detect the error if the issue can't be reproduced.
183
183
184
184
> [!div class="mx-imgBorder"]
185
185
> 
@@ -190,7 +190,7 @@ A common cause is an [OnSave](https://docs.microsoft.com/powerapps/developer/mod
190
190
191
191
**Resolution**:
192
192
193
-
In Monitor, the `FormEvents.onsave` operation provides all the details why the save event was canceled, more details than are available from the form UI itself.<!--note from editor: Edit okay? I wasn't sure what this was saying.-->
193
+
In Monitor, the `FormEvents.onsave` operation provides all the details why the save event was canceled, more details than that are available from the form UI itself.
@@ -238,11 +238,11 @@ There are many possible reasons for a form to freeze, load slowly, or throw a "W
238
238
239
239
**Resolution**:
240
240
241
-
- Use the `DisableFormCommandbar`<!--note from editor: As noted above, these flag have mostly been formatted in code font, so I'm changing them in this section to be consistent. If there's a reason behind the switch in format, please excuse!--> flag and refresh the page. If the issue is resolved, it was caused by some command customization.
241
+
- Use the **DisableFormCommandbar** flag and refresh the page. If the issue is resolved, it was caused by some command customization.
242
242
243
-
- If the issue persists, use the `DisableFormHandlers=true` flag. If the issue still isn't resolved, you can further identify the exact event handler function that's causing the problem.
243
+
- If the issue persists, use the **DisableFormHandlers=true** flag. If the issue still isn't resolved, you can further identify the exact event handler function that's causing the problem.
244
244
245
-
- Assuming the form has 10 libraries, and 20 `OnLoad` event handlers, you can use the binary search approach to narrow down the handler index range as described in the following example:<!--note from editor: Edit okay? I assume you're setting up an example here. Also, is it okay to make the following an ordered list?-->
245
+
- Assuming the form has 10 libraries, and 20 `OnLoad` event handlers, you can use the binary search approach to narrow down the handler index range as described in the following example:
246
246
247
247
1. Open [Monitor](https://docs.microsoft.com/powerapps/maker/model-driven-apps/monitor-form-checker) to view the registered form event handlers and libraries to get the list of `OnLoad` event handlers of indexes ranging from 0 through 19 and form libraries of indexes ranging from 0 through 9.
248
248
@@ -286,7 +286,7 @@ There are many reasons why a related menu item doesn't appear on the **Related**
286
286
**Resolution**:
287
287
288
288
In the following example, a related entity `role` (security role) doesn't appear in the `team` form because the `role` entity isn't available in Unified Interface.
289
-
<!--note from editor: Will the preceding text be enough to explain this concept if the reader can't see the image (due to low vision or having turned images off)? If not, please augment the alt text so that it fully explains this idea. We have to be sure that the image doesn't carry all the meaning. This is a question for all the following images.-->
0 commit comments