Skip to content

Commit 0e9fe69

Browse files
authored
Merge branch 'main' into mints-troubleshoot-tah
2 parents a90cb60 + 1b94d7a commit 0e9fe69

File tree

5 files changed

+109
-8
lines changed

5 files changed

+109
-8
lines changed

powerapps-docs/developer/model-driven-apps/TOC.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,8 @@
9393
href: clientapi/reference/events/attribute-onchange.md
9494
- name: Form OnLoad event
9595
href: clientapi/reference/events/form-onload.md
96+
- name: Form Loaded event
97+
href: clientapi/reference/events/form-loaded.md
9698
- name: Form OnSave event
9799
href: clientapi/reference/events/form-onsave.md
98100
- name: Form data OnLoad event
@@ -502,6 +504,8 @@
502504
items:
503505
- name: addOnLoad
504506
href: clientapi/reference/formcontext-ui/addOnLoad.md
507+
- name: addLoaded
508+
href: clientapi/reference/formcontext-ui/addloaded.md
505509
- name: clearFormNotification
506510
href: clientapi/reference/formcontext-ui/clearFormNotification.md
507511
- name: close
@@ -516,6 +520,8 @@
516520
href: clientapi/reference/formcontext-ui/refreshRibbon.md
517521
- name: removeOnLoad
518522
href: clientapi/reference/formcontext-ui/removeOnLoad.md
523+
- name: removeLoaded
524+
href: clientapi/reference/formcontext-ui/removeloaded.md
519525
- name: setFormEntityName
520526
href: clientapi/reference/formcontext-ui/setFormEntityName.md
521527
- name: setFormNotification

powerapps-docs/developer/model-driven-apps/clientapi/events-forms-grids.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
---
22
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*.
44
author: HemantGaur
55
ms.author: hemantg
6-
7-
ms.date: 04/01/2022
6+
ms.date: 07/08/2024
87
ms.reviewer: jdaly
98
ms.topic: reference
109
ms.subservice: mda-developer
@@ -16,9 +15,9 @@ contributors:
1615
---
1716
# Events in forms and grids in model-driven apps
1817

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

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

2322
[!INCLUDE[cc-terminology](../../data-platform/includes/cc-terminology.md)]
2423

@@ -41,7 +40,7 @@ To add or remove event handler functions to events in the new Unified Interface:
4140

4241
![Select form from list.](../media/select-form-from-list.png "Select form from list")
4342

44-
1. Select **Events** tab. You'll notice that both the **On Save** and **On Load** event handlers.
43+
1. Select **Events** tab. Notice both the **On Save** and **On Load** event handlers.
4544

4645
![Form event handlers.](../media/form-event-handlers.png "Form event handlers")
4746

@@ -63,12 +62,13 @@ To determine when an event handler is called on a form in bulk edit mode use [`g
6362

6463
## Add or remove event handler function to event using code
6564

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:
6766

6867
|Events |Event handler|
6968
|-------|-------|
7069
|Attribute [OnChange](reference/events/attribute-onchange.md) | [addOnChange](reference/attributes/addonchange.md) and [removeOnChange](reference/attributes/removeOnchange.md) methods|
7170
|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|
7272
|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|
7373
|Form [OnSave](reference/events/form-onsave.md)| [addOnSave](reference/formcontext-data-entity/addonsave.md) and [removeOnSave](reference/formcontext-data-entity/removeonsave.md) methods|
7474
|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
8181
8282
## Form event pipeline
8383

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

8686
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.
8787

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
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.
20+
21+
[!INCLUDE[footer-include](../../../../../includes/footer-banner.md)]
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
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).|
28+
29+
### Related articles
30+
31+
[removeLoaded](removeloaded.md)
32+
[Form Loaded event](../events/form-loaded.md)
33+
[formContext.ui](../formContext-ui.md)
34+
[formContext](../../clientapi-form-context.md)
35+
36+
37+
38+
[!INCLUDE[footer-include](../../../../../includes/footer-banner.md)]
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
---
2+
title: "ui.removeLoaded (Client API reference) in model-driven apps| MicrosoftDocs"
3+
description: Includes description and supported parameters for the ui.removeLoaded 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.removeLoaded (Client API reference)
16+
17+
Removes a function from the form [Loaded](../events/form-loaded.md) event.
18+
19+
## Syntax
20+
21+
`formContext.ui.removeLoaded(myFunction)`
22+
23+
## Parameter
24+
25+
|Name|Type|Required|Description|
26+
|--|--|--|--|
27+
|`myFunction`|function reference|Yes|The function to be removed from the form [Loaded](../events/form-loaded.md) event.
28+
29+
### Related articles
30+
31+
[addLoaded](addloaded.md)
32+
[Form Loaded event](../events/form-loaded.md)
33+
[formContext.ui](../formContext-ui.md)
34+
[formContext](../../clientapi-form-context.md)
35+
36+
[!INCLUDE[footer-include](../../../../../includes/footer-banner.md)]

0 commit comments

Comments
 (0)