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/clientapi/events-forms-grids.md
+8-8Lines changed: 8 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -1,10 +1,9 @@
1
1
---
2
2
title: "Events in forms and grids in model-driven apps| MicrosoftDocs"
3
-
description: All client-side code is initiated by events. In model-driven apps, you associate a specific function in a JavaScript library to be executed when an event occurs. This function is called an *event handler*.
3
+
description: Events initiate all client-side code. In model-driven apps, you associate a specific function in a JavaScript library to be executed when an event occurs. This function is called an *event handler*.
4
4
author: HemantGaur
5
5
ms.author: hemantg
6
-
7
-
ms.date: 04/01/2022
6
+
ms.date: 07/08/2024
8
7
ms.reviewer: jdaly
9
8
ms.topic: reference
10
9
ms.subservice: mda-developer
@@ -16,9 +15,9 @@ contributors:
16
15
---
17
16
# Events in forms and grids in model-driven apps
18
17
19
-
All client-side code is initiated by events. In model-driven apps, you associate a specific function in a JavaScript library ([Script web resource](../script-jscript-web-resources.md)) to be executed when an event occurs. This function is called an *event handler*. Each event handler specifies a single function within a JavaScript library and any parameters that can be passed to the function.
18
+
Events initiate all client-side code. In model-driven apps, you associate a specific function in a JavaScript library ([Script web resource](../script-jscript-web-resources.md)) to be executed when an event occurs. This function is called an *event handler*. Each event handler specifies a single function within a JavaScript library and any parameters that can be passed to the function.
20
19
21
-
You can associate event handlers to only some events using the UI. For events that are not available to be associated through UI, Client API provides methods that can be used to attach event handlers to such events.
20
+
You can associate event handlers to only some events using the UI. For events that aren't available to be associated through UI, Client API provides methods that can be used to attach event handlers to such events.
@@ -63,12 +62,13 @@ To determine when an event handler is called on a form in bulk edit mode use [`g
63
62
64
63
## Add or remove event handler function to event using code
65
64
66
-
Using the following methods to add and remove event handler for events that cannot be associated through UI:
65
+
Using the following methods to add and remove event handler for events that can't be associated through UI:
67
66
68
67
|Events |Event handler|
69
68
|-------|-------|
70
69
|Attribute [OnChange](reference/events/attribute-onchange.md)|[addOnChange](reference/attributes/addonchange.md) and [removeOnChange](reference/attributes/removeOnchange.md) methods|
71
70
|Form [OnLoad](reference/events/form-onload.md)| formContext.ui [addOnLoad](reference/formcontext-ui/addonload.md) and [removeOnLoad](reference/formcontext-ui/removeonload.md) methods|
71
+
|Form [Loaded](reference/events/form-loaded.md)| formContext.ui [addLoaded](reference/formcontext-ui/addloaded.md) and [removeLoaded](reference/formcontext-ui/removeloaded.md) methods|
72
72
|Form data [OnLoad](reference/events/form-data-onload.md)| formContext.data [addOnLoad](reference/formcontext-data/addonload.md) and [removeOnLoad](reference/formcontext-data/removeonload.md) methods|
73
73
|Form [OnSave](reference/events/form-onsave.md)|[addOnSave](reference/formcontext-data-entity/addonsave.md) and [removeOnSave](reference/formcontext-data-entity/removeonsave.md) methods|
74
74
|Lookup control [PreSearch](reference/events/presearch.md)|[addPreSearch](reference/controls/addpresearch.md) and [removePreSearch](reference/controls/removepresearch.md) methods|
@@ -81,7 +81,7 @@ Using the following methods to add and remove event handler for events that cann
81
81
82
82
## Form event pipeline
83
83
84
-
You can define up to 50 event handlers for each event. Each event handler is executed in the order that it is displayed in the **Event Handlers** section in the **Events** tab of the **Form Properties** dialog box.
84
+
You can define up to 50 event handlers for each event. Each event handler is executed in the order that it's displayed in the **Event Handlers** section in the **Events** tab of the **Form Properties** dialog box.
85
85
86
86
Use the [setSharedVariable](reference/executioncontext/setSharedVariable.md) and [getSharedVariable](reference/executioncontext/getSharedVariable.md) methods to pass a common variable between event handlers (functions). Use the execution context [getDepth](reference/executioncontext/getDepth.md) method to know the sequence that an event handler is being executed in relative to other event handlers.
title: "Form Loaded event (Client API reference) in model-driven apps | MicrosoftDocs"
3
+
description: Includes description and supported parameters for the Loaded event.
4
+
author: aorth
5
+
ms.author: aorth
6
+
ms.date: 07/02/2024
7
+
ms.reviewer: jdaly
8
+
ms.topic: reference
9
+
applies_to: "Dynamics 365 (online)"
10
+
search.audienceType:
11
+
- developer
12
+
contributors:
13
+
- JimDaly
14
+
---
15
+
# Form Loaded event
16
+
17
+
This event occurs after the form load completes. App logic that isn't immediately needed during the form load process should be run after load completes. For example, moving extra APIs calls after form load completes can significantly improve the loading experience and reduce time to first use.
18
+
19
+
Use the formContext.ui.[addLoaded](../formContext-ui/addLoaded.md) and formContext.ui.[removeLoaded](../formContext-ui/removeLoaded.md) methods to manage event handlers for this event.
title: "ui.addLoaded (Client API reference) in model-driven apps| MicrosoftDocs"
3
+
description: Includes description and supported parameters for the ui.addLoaded method.
4
+
author: aorth
5
+
ms.author: aorth
6
+
ms.date: 07/08/2024
7
+
ms.reviewer: jdaly
8
+
ms.topic: reference
9
+
applies_to: "Dynamics 365 (online)"
10
+
search.audienceType:
11
+
- developer
12
+
contributors:
13
+
- JimDaly
14
+
---
15
+
# ui.addLoaded (Client API reference)
16
+
17
+
Adds a function to be called on the form [Loaded](../events/form-loaded.md) event that happens after the form completes the load process.
18
+
19
+
## Syntax
20
+
21
+
`formContext.ui.addLoaded(myFunction)`
22
+
23
+
## Parameter
24
+
25
+
|Name|Type|Required|Description|
26
+
|--|--|--|--|
27
+
|`myFunction`|function reference|Yes|The function to be executed on the form [Loaded](../events/form-loaded.md) event. The function is added to the bottom of the event handler pipeline. The execution context is automatically passed as the first parameter to the function. For more information, see [Execution context](../../clientapi-execution-context.md).|
0 commit comments