Skip to content

Commit 2209d7b

Browse files
authored
Update form-onload.md
Added links to other async docs
1 parent ca1e1bb commit 2209d7b

File tree

1 file changed

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

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Controls and other UI of the form are not guaranteed to be rendered and in the D
2828

2929
Logic in an `OnLoad` event handler cannot prevent the form from loading.
3030

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.
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.
3232

3333
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.
3434

0 commit comments

Comments
 (0)