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/reference/executioncontext/getEventArgs.md
+15-14Lines changed: 15 additions & 14 deletions
Original file line number
Diff line number
Diff line change
@@ -1,10 +1,9 @@
1
1
---
2
2
title: "getEventArgs (Client API reference) in model-driven apps| MicrosoftDocs"
3
3
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
8
7
ms.reviewer: jdaly
9
8
ms.topic: reference
10
9
applies_to: "Dynamics 365 (online)"
@@ -28,25 +27,27 @@ Returns an object with methods to manage the events.
28
27
29
28
**Type**: Object
30
29
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:
|[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*|
|[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)]|
40
39
|[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).|
|[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)|
|[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`.|
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.
Copy file name to clipboardExpand all lines: powerapps-docs/maker/canvas-apps/power-apps-ideas-train-examples.md
+16-14Lines changed: 16 additions & 14 deletions
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
---
2
2
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.
4
4
author: norliu
5
5
6
6
ms.topic: article
@@ -20,24 +20,26 @@ contributors:
20
20
21
21
# Transform examples to Power Fx formulas
22
22
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.
23
24
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.
27
26
28
27
## Work with dates in a gallery
29
28
30
29
To work with and manipulate dates in a gallery using Power Apps Ideas:
31
30
32
31
1. Select your target label. For this example, we'll use **Created On**. Select the date field and then select **Format data**.
33
32
34
-

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.

42
44
43
45
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:
58
60
59
61
## Use Train with examples in your app
60
62
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.
62
64
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".
64
66
65
67
To achieve this scenario, use **Add examples** by providing such examples using the **Ideas** pane:
66
68
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.
68
70
69
71
You can add up to 20 examples but typically you only need two or three examples for Ideas to start working.
70
72
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.
72
74
73
75
1. Select and apply to see if it meets your needs.
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.
80
82
81
83
## Supported and unsupported capabilities
82
84
83
85
The following capabilities are supported:
84
86
85
87
- Converting a single date field in a table to a different format
86
88
- 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
88
90
- Works only for label text in a gallery
89
91
- All available languages and data connectors as supported by Power Apps regions
90
92
@@ -100,5 +102,5 @@ The following capabilities aren't supported:
0 commit comments