Skip to content

Commit 82491e1

Browse files
committed
Updating links
1 parent 2209d7b commit 82491e1

File tree

1 file changed

+4
-7
lines changed
  • powerapps-docs/developer/model-driven-apps/clientapi/reference/events

1 file changed

+4
-7
lines changed

powerapps-docs/developer/model-driven-apps/clientapi/reference/events/form-onload.md

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,17 @@ search.app:
1717
# Form OnLoad Event (Client API reference)
1818

1919

20-
2120
The form `OnLoad` event occurs after the form has loaded. It also occurs after a record is created, for example by selecting the **Save** button on the main form. Use the `OnLoad` event to apply logic about how the form should be displayed, to set properties on fields, and interact with other page elements.
2221

2322
You can determine in what context the `OnLoad` event occurs by using [getEventArgs](../executioncontext/getEventArgs.md). By doing so, you can apply logic conditional on the context.
2423

25-
Data for related entities on a form, such as data for subgrids and quick view forms, are not guaranteed to be available when an `OnLoad` event handler is executed. Logic that depends on related data should use the subgrid onload event, the quick view form isLoaded function, or the appropriate manner for determining when related data is loaded for the particular related data.
26-
27-
Controls and other UI of the form are not guaranteed to be rendered and in the DOM when the `OnLoad` event occurs.
24+
Data for related entities on a form, such as data for subgrids and quick view forms are not guaranteed to be available when the `OnLoad` event handler is executed. Logic that depends on related data should use the [Subgrid OnLoad](https://docs.microsoft.com/powerapps/developer/model-driven-apps/clientapi/reference/events/subgrid-onload) event, quick view form should use the [isLoaded](https://docs.microsoft.com/powerapps/developer/model-driven-apps/clientapi/reference/formcontext-ui-quickforms/isloaded) function, or the appropriate function for determining when the data should be loaded for the particular related data.
2825

29-
Logic in an `OnLoad` event handler cannot prevent the form from loading.
26+
Controls and other UI of the form are not guaranteed to be rendered and in the DOM when the `OnLoad` event occurs. Logic in the `OnLoad` event handler cannot prevent the form from loading.
3027

31-
The form `OnLoad` events are synchronous. However, you should **not** make synchronous network requests in an `OnLoad` event handler. This can cause a slow save experience and an unresponsive app. Instead, you should [asynchronous network requests](https://docs.microsoft.com/en-us/powerapps/developer/model-driven-apps/best-practices/business-logic/interact-http-https-resources-asynchronously). Using asynchronous requests will [dramatically improve the performance of form loads](https://powerapps.microsoft.com/en-us/blog/turbocharge-your-model-driven-apps-by-transitioning-away-from-synchronous-requests/) compared to using synchronous requests.
28+
The form `OnLoad` events are synchronous. However, you should **not** make synchronous network requests in an `OnLoad` event handler. This can cause a slow save experience and an unresponsive app. Instead, you should [asynchronous network requests](https://docs.microsoft.com/powerapps/developer/model-driven-apps/best-practices/business-logic/interact-http-https-resources-asynchronously). Using asynchronous requests will [dramatically improve the performance of form loads](https://powerapps.microsoft.com/blog/turbocharge-your-model-driven-apps-by-transitioning-away-from-synchronous-requests/) compared to using synchronous requests.
3229

33-
You should be careful when using asynchronous code in an `OnLoad` event handler that needs an action to be taken or handled on the resolution of the async code. Asynchronous code can cause issues if the resolution handler expects the app context to remain the same as it was when the asynchronous code has started. For example, there may be code in an `OnLoad` event handler to make a network request and change a control to be disabled based on the response data. Before the response from the request is receieved, the user may have interacted with the control or navigated to a different page, so there may be undesired behavior. If you need to not show data or UI before the asynchronous requests complete, your code can hide or disable the relevant UI until the requests are complete. Your code should also check that the user is in the same context after each asynchronous continuation point.
30+
You should be careful when using asynchronous code in an `OnLoad` event handler that needs an action to be taken or handled on the resolution of the async code. Asynchronous code can cause issues if the resolution handler expects the app context to remain the same as it was when the asynchronous code has started. For example, there may be code in an `OnLoad` event handler to make a network request and change a control to be disabled based on the response data. Before the response from the request is received, the user may have interacted with the control or navigated to a different page, so there may be undesired behavior. If you need to not show data or UI before the asynchronous requests complete, your code can hide or disable the relevant UI until the requests are complete. Your code should also check that the user is in the same context after each asynchronous continuation point.
3431

3532

3633

0 commit comments

Comments
 (0)