Skip to content

Commit 458d73e

Browse files
committed
Merge remote-tracking branch 'origin/main' into matp-3011780
2 parents 0cf073a + 53ded4b commit 458d73e

File tree

7 files changed

+121
-109
lines changed

7 files changed

+121
-109
lines changed

powerapps-docs/developer/model-driven-apps/clientapi/reference/executioncontext/getEventArgs.md

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
---
22
title: "getEventArgs (Client API reference) in model-driven apps| MicrosoftDocs"
33
description: "Learn about the getEventArgs method that returns an object with methods to manage the **Save** event."
4-
ms.author: jdaly
5-
author: adrianorth
6-
manager: kvivek
7-
ms.date: 09/14/2022
4+
ms.author: hemantg
5+
author: HemantGaur
6+
ms.date: 11/02/2022
87
ms.reviewer: jdaly
98
ms.topic: reference
109
applies_to: "Dynamics 365 (online)"
@@ -28,25 +27,27 @@ Returns an object with methods to manage the events.
2827

2928
**Type**: Object
3029

31-
**Description**: See the below table for the object type information:
30+
**Description**: When a specified event occurs, you can use the `getEventArgs` method of the execution context object to retrieve an object that may contain additional methods you can use. The table below describes the methods:
3231

33-
|Events|Return Object|
32+
|Events|Return Object Methods|
3433
|-------|------------|
3534
|[OnChange](../events/attribute-onchange.md)|None|
36-
|[OnDataLoad](../events/form-data-onload.md)|When the form `OnDataLoad` event occurs, you can use the `getEventArgs` method of the execution context object to retrieve an object that contains the following method: <br/> **getDataLoadState**: Gets the state of the data load. It returns an enum with the following values:<br/> - *InitialLoad =1*<br/>- *Save = 2*<br/>- *Refresh = 3*|
35+
|[OnDataLoad](../events/form-data-onload.md)|**getDataLoadState**: Gets the state of the data load. It returns an enum with the following values:<br/> - *InitialLoad =1*<br/>- *Save = 2*<br/>- *Refresh = 3*|
3736
|[OnGridDataLoad](../events/subgrid-onload.md)|None|
38-
|[OnLoad](../events/form-onload.md)|When the form `OnLoad` event occurs, you can use the `getEventArgs` method of the execution context object to retrieve an object that contains the following method: <br/>**getDataLoadState**: Gets the state of the data load. It returns an enum with the following values:<br/> - *InitialLoad =1*<br/>- *Save = 2*<br/>- *Refresh = 3*|
39-
|[OnLookupTagClick](../events/onlookuptagclick.md)| When the form `OnLookupTagClick` event occurs, you can use the `getEventArgs` method of the execution context object to retrieve an object that contains the following methods: <br/>- **getTagValue**: Gets the selected tag value. The value returned for the `getTagValue` method is a [LookupValue](../attributes/getvalue.md).<br/>- [preventDefault](../save-event-arguments/preventdefault.md)<br/> - [isDefaultPrevented](../save-event-arguments/isdefaultprevented.md)|
37+
|[OnLoad](../events/form-onload.md)|**getDataLoadState**: Gets the state of the data load. It returns an enum with the following values:<br/> - *InitialLoad =1*<br/>- *Save = 2*<br/>- *Refresh = 3*|
38+
|[OnLookupTagClick](../events/onlookuptagclick.md)| - **getTagValue**: Gets the selected tag value. The value returned for the `getTagValue` method is a [LookupValue](../attributes/getvalue.md).<br/>- [preventDefault](../save-event-arguments/preventdefault.md): [!INCLUDE [preventDefault-description](../save-event-arguments/includes/preventDefault-description.md)]<br/> - [isDefaultPrevented](../save-event-arguments/isdefaultprevented.md): [!INCLUDE [isDefaultPrevented-description](../save-event-arguments/includes/isDefaultPrevented-description.md)]|
4039
|[OnPostSearch](../events/postsearch.md)|None|
41-
|[PostSave Event](../events/postsave.md)|When the form `PostSave` event occurs, you can use the `getEventArgs` method of the execution context object to retrieve an object that contains the following methods:<br /> - [getEntityReference](../save-event-arguments/getEntityReference.md) Returns data about the record being saved.<br /> - [getIsSaveSuccess](../save-event-arguments/getIsSaveSuccess.md) Returns data about whether the save operation succeeded.<br /> - [getSaveErrorInfo](../save-event-arguments/getSaveErrorInfo.md) If the save operation failed, returns data about why it failed.|
42-
|[OnProcessStatusChange](../events/onprocessstatuschange.md)|When the form `OnProcessStatusChange` event occurs, you can use the `getEventArgs` method of the execution context object to retrieve an object that contains the following methods: <br/> - **getStage**: Gets the stage object corresponding to the event triggered. Returns the selected stage in for the `OnStageSelected` event and next or previous stage objects for the `OnStageChange` event depending on direction moved. More information: [Stage methods](../formcontext-data-process.md#stage-methods).<br/>- **getDirection**: Gets the direction of the stage advance action. It returns a string value `Next` or `Previous`.|
40+
|[PostSave Event](../events/postsave.md)|- [getEntityReference](../save-event-arguments/getEntityReference.md): [!INCLUDE [getEntityReference-description](../formContext-data-entity/includes/getEntityReference-description.md)]<br /> - [getIsSaveSuccess](../save-event-arguments/getIsSaveSuccess.md): Returns data about whether the save operation succeeded.<br /> - [getSaveErrorInfo](../save-event-arguments/getSaveErrorInfo.md): If the save operation failed, returns data about why it failed.|
41+
|[OnProcessStatusChange](../events/onprocessstatuschange.md)|- **getStatus**: Returns the Business Process Flow status: `Active`, `Finished`, or `Aborted`.|
42+
|[OnPreProcessStatusChange](../events/onpreprocessstatuschange.md)|- **getStatus**: Returns the Business Process Flow status: `Active`, `Finished`, or `Aborted`.|
43+
|[OnPreStageChange event](../events/onprestagechange.md)|- **getStage**: Gets the stage object corresponding to the event triggered. Returns the selected stage in for the `OnStageSelected` event and next or previous stage objects for the `OnStageChange` event depending on direction moved. More information: [Stage methods](../formcontext-data-process.md#stage-methods).|
4344
|[OnReadyStateComplete](../events/onreadystatecomplete.md)|None|
4445
|[OnRecordSelect](../events/grid-onrecordselect.md)|None|
4546
|[OnResultOpened](../events/onresultopened.md)|None|
46-
|[OnSave](../events/form-onsave.md)|When the form `OnSave` event occurs, you can use the `getEventArgs` method of the execution context object to retrieve an object that contains the following methods: <br/>- [getSaveMode](../save-event-arguments/getsavemode.md)<br/>- [preventDefault](../save-event-arguments/preventdefault.md)<br/> - [isDefaultPrevented](../save-event-arguments/isdefaultprevented.md)|
47+
|[OnSave](../events/form-onsave.md)|- [getSaveMode](../save-event-arguments/getsavemode.md): [!INCLUDE [getSaveMode-description](../save-event-arguments/includes/getSaveMode-description.md)]<br/>- [preventDefault](../save-event-arguments/preventdefault.md): [!INCLUDE [preventDefault-description](../save-event-arguments/includes/preventDefault-description.md)]<br/> - [isDefaultPrevented](../save-event-arguments/isdefaultprevented.md): [!INCLUDE [isDefaultPrevented-description](../save-event-arguments/includes/isDefaultPrevented-description.md)]|
4748
|[OnSelection](../events/onselection.md)|None|
48-
|[OnStageChange](../events/onstagechange.md)|When the form `OnStageChange` event occurs, you can use the `getEventArgs` method of the execution context object to retrieve an object that contains the following methods: <br/>- **getStage**: Gets the stage object corresponding to the event triggered. Returns the selected stage in for the `OnStageSelected` event and next or previous stage objects for the `OnStageChange` event depending on direction moved.More information: [Stage methods](../formcontext-data-process.md#stage-methods).<br/>- **getDirection**: Gets the direction of the stage advance action. It returns a string value `Next` or `Previous`.|
49-
|[OnStageSelected](../events/onstageselected.md)|When the form `OnStageSelected` event occurs, you can use the `getEventArgs` method of the execution context object to retrieve an object that contains the following methods: <br/>- **getStage**: Gets the stage object corresponding to the event triggered. Returns the selected stage in for the `OnStageSelected` event and next or previous stage objects for the `OnStageChange` event depending on direction moved. More information: [Stage methods](../formcontext-data-process.md#stage-methods).<br/>- **getDirection**: Gets the direction of the stage advance action. It returns a string value `Next` or `Previous`.|
49+
|[OnStageChange](../events/onstagechange.md)|- **getStage**: Gets the stage object corresponding to the event triggered. Returns the selected stage in for the `OnStageSelected` event and next or previous stage objects for the `OnStageChange` event depending on direction moved. More information: [Stage methods](../formcontext-data-process.md#stage-methods).<br/>- **getDirection**: Gets the direction of the stage advance action. It returns a string value `Next` or `Previous`.|
50+
|[OnStageSelected](../events/onstageselected.md)|- **getStage**: Gets the stage object corresponding to the event triggered. Returns the selected stage in for the `OnStageSelected` event and next or previous stage objects for the `OnStageChange` event depending on direction moved. More information: [Stage methods](../formcontext-data-process.md#stage-methods).<br/>- **getDirection**: Gets the direction of the stage advance action. It returns a string value `Next` or `Previous`.|
5051
|[OnTabStateChange](../events/tabstatechange.md)|None|
5152
|[PreSearch](../events/presearch.md)|None|
5253

Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Gets a boolean value indicating whether all of the form data is valid. This includes the main table and any unbound columns. If the form has empty required columns on it, control-level error notifications is shown.
1+
Gets a boolean value indicating whether all of the form data is valid. If the form has empty required columns on it, control-level error notifications will be shown. A column may also be set as invalid using the [setIsValid method](../../attributes/setIsValid.md) setIsValid method.

powerapps-docs/maker/canvas-apps/power-apps-ideas-train-examples.md

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: "Transform examples to Power Fx formulas"
3-
description: Learn about how to train Power Apps with your own examples and generate formulas using Power Apps Ideas.
3+
description: Learn how to train Power Apps with your own examples and generate formulas using Power Apps Ideas.
44
author: norliu
55

66
ms.topic: article
@@ -20,24 +20,26 @@ contributors:
2020

2121
# Transform examples to Power Fx formulas
2222

23+
Most of us have struggled at times with manipulation of text when building apps. For help, we search online for tips and examples, or tools to test RegEx patterns. **Train with examples** uses [PROSE](https://www.microsoft.com/research/group/prose/) (Programming by Examples and Natural Language) so you can now just provide one or more desired outputs, and then Power Apps can automatically generate the formula for you.
2324

24-
We all had the time when we struggled with manipulation of text when we’re building apps. Searching online for tips and examples, or tools to test RegEx patterns. **Train with examples** uses [PROSE](https://www.microsoft.com/research/group/prose/) (Programming by Examples and Natural Language) so you can now just give us one or more desired output, and then Power Apps can automatically generate the formula for you.
25-
26-
Let's use a simple app to show you how to use this feature. You can follow [Create an app from scratch](data-platform-create-app-scratch.md) to create a sample app. In the following example, we're using the **Accounts** table in Dataverse with sample data that gets installed when you choose to install sample data while creating the environment. You can also use your own table if you don't have sample data.
25+
Let's use a simple app to show how to use this feature. You can follow [Create an app from scratch](data-platform-create-app-scratch.md) to create a sample app. In the following example, we're using the **Accounts** table in Dataverse with sample data that you can choose to install while creating the environment. You can also use your own table if you don't have sample data.
2726

2827
## Work with dates in a gallery
2928

3029
To work with and manipulate dates in a gallery using Power Apps Ideas:
3130

3231
1. Select your target label. For this example, we'll use **Created On**. Select the date field and then select **Format data**.
3332

34-
![Power Apps Ideas demo.](media/power-apps-ideas/prose-entrypoint-c7.png "Find example to formula in Ideas pane")
33+
![Power Apps Ideas demo.](media/power-apps-ideas/prose-entrypoint-c7.png "Power Apps Ideas demo.")
3534

36-
1. Enter your output in the **Desired format** text box. Or use one of the listed examples, in this case **May 25, 2021**, and then press Enter. <br> Select the generated formula.
35+
1. Enter your output in the **Desired format** text box. Or use one of the listed examples, in this case **May 25, 2021**, and then press Enter.
36+
37+
Select the generated formula.
3738

3839
```powerapps-dot
3940
Text(DateTimeValue(ThisItem.'Created On'), "mmmm d", "en-US")
4041
```
42+
4143
![Select a desired format.](media/power-apps-ideas/prose-entrypoint-c7-1.png "Select a desired format.")
4244
4345
The formula is updated in the formula bar. You can now check the rest of the items in your gallery to see if the formula did the manipulation that you wanted.
@@ -58,33 +60,33 @@ To work with text display in a gallery using Power Apps Ideas:
5860
5961
## Use Train with examples in your app
6062
61-
In the above scenario, if you wanted to include the first word of the account name along with the last word's initial, the above formula will not work for all scenarios. This is because the above formula takes only the second word's initial in the name. And some account names have three or more words.
63+
In the above scenario, if you wanted to include the first word of the account name along with the last word's initial, the above formula would not work for all scenarios. That's because the above formula takes only the second word's initial in the name. And some account names have three or more words.
6264
63-
For example, "Alpine Ski House" becomes "Alpine S" whereas to have last word's initial, it should be "Alpine H".
65+
For example, "Alpine Ski House" becomes "Alpine S", whereas to have last word's initial, it should be "Alpine H".
6466
6567
To achieve this scenario, use **Add examples** by providing such examples using the **Ideas** pane:
6668
67-
1. Select **Add examples** and then select one of the values from your table. Type in the desired format. <br>
69+
1. Select **Add examples** and then select one of the values from your table. Type in the desired format.
6870
6971
You can add up to 20 examples but typically you only need two or three examples for Ideas to start working.
7072
71-
1. Press Enter or select the arrow button (**->**) to see new ideas.
73+
1. Press Enter or select the arrow button (**>**) to see new ideas.
7274
7375
1. Select and apply to see if it meets your needs.
7476
7577
```powerapps-dot
7678
First(Split(ThisItem.'Account Name', " ")).Result & Mid(Left(ThisItem.'Account Name', First(LastN(MatchAll(ThisItem.'Account Name', "\ "), 2)).StartMatch + 1), First(LastN(MatchAll(ThisItem.'Account Name', "\ "), 2)).StartMatch)
7779
```
7880
79-
You've just used **Transform examples to Power Fx formulas** capability and generated formula using Power Apps Ideas for the specific requirement that couldn't be achieved using the natural language alone.
81+
Now you've used the **Transform examples to Power Fx formulas** capability and generated a formula using Power Apps Ideas for the specific requirement that couldn't be achieved using the natural language alone.
8082
8183
## Supported and unsupported capabilities
8284
8385
The following capabilities are supported:
8486
8587
- Converting a single date field in a table to a different format
8688
- Converting a single text field in a table to a different format
87-
- Converting a single number field in a table to different format
89+
- Converting a single number field in a table to a different format
8890
- Works only for label text in a gallery
8991
- All available languages and data connectors as supported by Power Apps regions
9092
@@ -100,5 +102,5 @@ The following capabilities aren't supported:
100102
### See also
101103
102104
- [Formula reference](formula-reference.md)
103-
- [Power Apps Ideas overview (preview)](power-apps-ideas.md)
104-
- [Transform natural language to Power Fx formulas (preview)](power-apps-ideas-transform.md)
105+
- [Power Apps Ideas overview](power-apps-ideas.md)
106+
- [Transform natural language to Power Fx formulas](power-apps-ideas-transform.md)

0 commit comments

Comments
 (0)