Skip to content

Commit 12906a1

Browse files
authored
Merge branch 'main' into ericcolvinmorgan/dual-write-updates
2 parents 67c539e + 60b8f3d commit 12906a1

File tree

66 files changed

+19321
-233
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+19321
-233
lines changed

powerapps-docs/developer/data-platform/TOC.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,9 @@
126126
items:
127127
- name: Use DeleteMultiple (preview)
128128
href: deletemultiple.md
129+
- name: Restore deleted records (preview)
130+
displayName: RecycleBin, Restore
131+
href: restore-deleted-records.md
129132
- name: Create your own messages
130133
href: custom-actions.md
131134
items:

powerapps-docs/developer/data-platform/restore-deleted-records.md

Lines changed: 1031 additions & 0 deletions
Large diffs are not rendered by default.

powerapps-docs/developer/data-platform/search/custom-search-analyzer.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ contributors:
1717
---
1818
# Custom column analyzers for Dataverse Search
1919

20-
Dataverse search uses many different [Azure AI Search](/azure/search/search-what-is-azure-search) capabilities that include both index and search analyzers to return the best data based on what the user asks for. These built-in capabilities to help define how an index maps certain phrases or words to the best match to data in a column and a row in a table.
20+
Dataverse search uses many different [Azure AI Search](/azure/search/search-what-is-azure-search) capabilities that include both index and search analyzers to return the best data based on what the user asks for. These built-in capabilities help to define how an index maps certain phrases or words to the best match to data in a column and a row in a table.
2121

2222
Examples include search strings that have special characters, or frequently used words (like '`of`' and '`or`') that the back-end data engine removes from the search term when the query is processed.
2323

Lines changed: 170 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,170 @@
1+
---
2+
title: "Web API table schema operations sample (PowerShell) (Microsoft Dataverse)| Microsoft Docs"
3+
description: "This sample demonstrates how to perform operations that change the Dataverse data structures using the Web API with PowerShell."
4+
ms.date: 05/14/2024
5+
author: mkannapiran
6+
ms.author: kamanick
7+
ms.reviewer: jdaly
8+
search.audienceType:
9+
- developer
10+
contributors:
11+
- JimDaly
12+
---
13+
14+
# Web API table schema operations sample (PowerShell)
15+
16+
[!INCLUDE[cc-terminology](../../includes/cc-terminology.md)]
17+
18+
This PowerShell sample demonstrates how to perform operations that create and modify table, column, and relationship definitions using the Dataverse Web API.
19+
20+
This sample implements the Dataverse operations and console output detailed in [Web API table schema operations sample](../web-api-metadata-operations-sample.md) and uses the [Dataverse Web API PowerShell Helper functions](https://github.com/microsoft/PowerApps-Samples/blob/master/dataverse/webapi/PS/README.md) to manage authentication and provide reusable functions to perform common operations. These scripts are referenced using [dot sourcing](/powershell/module/microsoft.powershell.core/about/about_scripts#script-scope-and-dot-sourcing) with the following lines:
21+
22+
```powershell
23+
. $PSScriptRoot\..\Core.ps1
24+
. $PSScriptRoot\..\TableOperations.ps1
25+
. $PSScriptRoot\..\CommonFunctions.ps1
26+
. $PSScriptRoot\..\MetadataOperations.ps1
27+
```
28+
29+
> [!NOTE]
30+
> This sample should work with Windows, Linux, and macOS, but has only been tested on Windows.
31+
32+
## Prerequisites
33+
34+
Before running this sample, you should read these articles that explain concepts and patterns used by these samples:
35+
36+
- [Quick Start Web API with PowerShell and Visual Studio Code](../quick-start-ps.md)
37+
- [Use PowerShell and Visual Studio Code with the Dataverse Web API](../use-ps-and-vscode-web-api.md)
38+
39+
These articles have the same prerequisites.
40+
41+
[!INCLUDE [cc-visual-studio-code-powershell-prerequisites](../../includes/cc-visual-studio-code-powershell-prerequisites.md)]
42+
43+
## How to run this sample
44+
45+
1. Clone or download the [PowerApps-Samples](https://github.com/microsoft/PowerApps-Samples) repository.
46+
1. Open the `/dataverse/webapi/PS/MetadataOperations/MetadataOperationsSample.ps1` file using Visual Studio Code
47+
1. Edit this line to use the URL of the environment you want to connect to:
48+
49+
`Connect 'https://yourorg.crm.dynamics.com/' # change this`
50+
51+
1. (Optional) Set the `$deleteCreatedRecords` variable to `$false` if you don't want to delete the records this sample creates.
52+
1. Press <kbd>F5</kbd> to run the sample.
53+
1. The first time you run the sample a browser window opens. In the browser window, enter or select the credentials you want to use to authenticate.
54+
55+
To connect as a different user, run the [Disconnect-AzAccount command](/powershell/module/az.accounts/disconnect-azaccount) and try again.
56+
57+
## Code
58+
59+
The code for this sample is at: [PowerApps-Samples/dataverse/webapi/PS/MetadataOperations/MetadataOperationsSample.ps1](https://github.com/microsoft/PowerApps-Samples/blob/master/dataverse/webapi/PS/MetadataOperations/MetadataOperationsSample.ps1)
60+
61+
## Demonstrates
62+
63+
This sample has 11 regions:
64+
65+
### Section 0: Create Publisher and Solution
66+
67+
Operations: Create a solution record and an associated publisher record.
68+
69+
> [!NOTE]
70+
> All solution components created in this sample will be associated to the solution so that they can be exported. For operations without a named message, this association is created using the `MSCRM.SolutionUniqueName` request header setting the solution unique name set as the value.
71+
> All names of solution components are prefixed using the publisher customization prefix.
72+
73+
### Section 1: Create, Retrieve and Update Table
74+
75+
Operations:
76+
77+
1. Create a new `sample_BankAccount` user-owned table by sending a `POST` request to `/EntityDefinitions`.
78+
1. Retrieve the created table by sending a `GET` request to `/EntityDefinitions(LogicalName='sample_bankaccount')`.
79+
1. Update the table by sending a `PUT` request to `/EntityDefinitions(LogicalName='sample_bankaccount')`.
80+
81+
### Section 2: Create, Retrieve and Update Columns
82+
83+
Operations:
84+
85+
1. Attempt to retrieve a `sample_boolean` boolean column by sending a `GET` request to `/EntityDefinitions(LogicalName='sample_bankaccount')/Attributes(LogicalName='sample_boolean')`.
86+
1. If the column doesn't already exist, create a new `sample_boolean` boolean column for the `sample_BankAccount` table by sending a `POST` request to `/EntityDefinitions(LogicalName='sample_bankaccount')/Attributes`.
87+
1. Update the `sample_boolean` boolean column by sending a `PUT` request to `/EntityDefinitions(LogicalName='sample_bankaccount')/Attributes(LogicalName='sample_boolean')`.
88+
1. Update the option labels for the `sample_boolean` boolean column using the [UpdateOptionValue action](xref:Microsoft.Dynamics.CRM.UpdateOptionValue).
89+
1. Attempt to retrieve a `sample_datetime` datetime column for the `sample_BankAccount` table, and create it if it doesn't exist.
90+
1. Attempt to retrieve a `sample_decimal` decimal column for the `sample_BankAccount` table, and create it if it doesn't exist.
91+
1. Attempt to retrieve a`sample_integer` integer column for the `sample_BankAccount` table, and create it if it doesn't exist.
92+
1. Attempt to retrieve a `sample_memo` memo column for the `sample_BankAccount` table, and create it if it doesn't exist.
93+
1. Attempt to retrieve a `sample_money` money column for the `sample_BankAccount` table, and create it if it doesn't exist.
94+
1. Attempt to retrieve a `sample_choice` choice column for the `sample_BankAccount` table, and create it if it doesn't exist.
95+
1. Add a new option to the `sample_choice` column using the [InsertOptionValue action](xref:Microsoft.Dynamics.CRM.InsertOptionValue).
96+
1. Change the order of the options of the `sample_choice` column using the [OrderOption action](xref:Microsoft.Dynamics.CRM.OrderOption).
97+
1. Delete one of the options of the `sample_choice` column using the [DeleteOptionValue action](xref:Microsoft.Dynamics.CRM.DeleteOptionValue).
98+
1. Attempt to retrieve a `sample_multiselectchoice` multi-select choice column for the `sample_BankAccount` table, and create it if it doesn't exist.
99+
1. Create a new Status option for the `sample_BankAccount` table using the [InsertStatusValue Action](xref:Microsoft.Dynamics.CRM.InsertStatusValue).
100+
101+
### Section 3: Create and use Global OptionSet
102+
103+
Operations:
104+
105+
1. Create a new global choice named `sample_colors` by sending a `POST` request to `/GlobalOptionSetDefinitions`.
106+
1. Retrieve the `sample_colors` global choice by sending a `GET` request to `/GlobalOptionSetDefinitions(<id value>)`.
107+
1. Create a new `sample_colors` choice column for the `sample_BankAccount` table using the `sample_colors` global choice by sending a `POST` request to `/EntityDefinitions(LogicalName='sample_bankaccount')/Attributes` and associating it to the global choice.
108+
109+
### Section 4: Create Customer Relationship
110+
111+
Operations:
112+
113+
1. Create a new `sample_customerid` customer column for the `sample_BankAccount` table using the [CreateCustomerRelationships Action](xref:Microsoft.Dynamics.CRM.CreateCustomerRelationships).
114+
1. Retrieve the `sample_customerid` customer column by sending a `GET` request to `/EntityDefinitions(LogicalName='sample_bankaccount')/Attributes(LogicalName='sample_customerid')`.
115+
1. Retrieve the relationships created for the customer column by sending `GET` requests to `/RelationshipDefinitions(<id>)/Microsoft.Dynamics.CRM.OneToManyRelationshipMetadata`.`.
116+
117+
### Section 5: Create and retrieve a one-to-many relationship
118+
119+
Operations:
120+
121+
1. Verify that the `sample_BankAccount` table is eligible to be referenced in a 1:N relationship using the [CanBeReferenced function](xref:Microsoft.Dynamics.CRM.CanBeReferenced).
122+
1. Verify that the `contact` table is eligible to be reference other tables in a 1:N relationship using the [CanBeReferencing function](xref:Microsoft.Dynamics.CRM.CanBeReferencing).
123+
1. Identify what other tables can reference the `sample_BankAccount` table in a 1:N relationship using the [GetValidReferencingEntities function](xref:Microsoft.Dynamics.CRM.GetValidReferencingEntities).
124+
1. Create a 1:N relationship between `sample_BankAccount` and `contact` tables by sending a `POST` request to `/RelationshipDefinitions`.
125+
1. Retrieve the 1:N relationship by sending `GET` request to `/RelationshipDefinitions(<id>)/Microsoft.Dynamics.CRM.OneToManyRelationshipMetadata`.
126+
127+
### Section 6: Create and retrieve a many-to-one relationship
128+
129+
Operations:
130+
131+
1. Create a N:1 relationship between `sample_BankAccount` and `account` tables by sending `POST` a request to `/RelationshipDefinitions`.
132+
1. Retrieve the N:1 relationship by sending a `GET` request to `/RelationshipDefinitions(<id>)/Microsoft.Dynamics.CRM.OneToManyRelationshipMetadata`.
133+
134+
### Section 7: Create and retrieve a many-to-many relationship
135+
136+
Operations:
137+
138+
1. Verify that the `sample_BankAccount` and `contact` tables are eligible to participate in a N:N relationship using the [CanManyToMany function](xref:Microsoft.Dynamics.CRM.CanManyToMany).
139+
1. Verify that the `sample_BankAccount` and `contact` tables are eligible to participate in a N:N relationship using the [GetValidManyToMany Function](xref:Microsoft.Dynamics.CRM.GetValidManyToMany).
140+
1. Create a N:N relationship between `sample_BankAccount` and `contact` tables by sending a `POST` request to `/RelationshipDefinitions`.
141+
1. Retrieve the N:N relationship by sending `GET` request to `/RelationshipDefinitions(<id>)/Microsoft.Dynamics.CRM.ManyToManyRelationshipMetadata`.
142+
143+
### Section 8: Export managed solution
144+
145+
Operations: Export the solution created in [Section 0: Create Publisher and Solution](#section-0-create-publisher-and-solution) containing the items created in this sample using the [ExportSolution Action](xref:Microsoft.Dynamics.CRM.ExportSolution).
146+
147+
### Section 9: Delete sample records
148+
149+
Operations: A reference to each record created in this sample was added to a list as it was created. In this sample the records are deleted in the reverse order in which they were created.
150+
151+
### Section 10: Import and Delete managed solution
152+
153+
Operations:
154+
155+
1. Import the solution exported in [Section 8](#section-8-export-managed-solution) using the [ImportSolution action](xref:Microsoft.Dynamics.CRM.ImportSolution).
156+
1. Query the solution table to get the `solutionid` of the imported solution.
157+
1. Delete the imported solution using the `solutionid`.
158+
159+
## Clean up
160+
161+
By default this sample will delete all the records created in it. If you want to view created records after the sample is completed, change the `deleteCreatedRecords` variable to `false` and you will be prompted to decide if you want to delete the records.
162+
163+
### See also
164+
165+
[Use the Dataverse Web API](../overview.md)<br />
166+
[Use the Web API with table definitions](../use-web-api-metadata.md)<br />
167+
[Web API Samples](../web-api-samples.md)<br />
168+
[Web API Basic Operations Sample (PowerShell)](basic-operations-powershell.md)
169+
170+
[!INCLUDE[footer-include](../../../../includes/footer-banner.md)]

powerapps-docs/developer/data-platform/webapi/samples/toc.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ items:
4949
href: ../web-api-samples-powershell.md
5050
- name: Basic Operations
5151
href: basic-operations-powershell.md
52+
- name: Metadata Operations
53+
href: metadata-operations-powershell.md
5254
- name: (JavaScript) samples
5355
items:
5456
- name: About the client-side samples

powerapps-docs/developer/data-platform/webapi/web-api-samples-powershell.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "Web API Data operations Samples PowerShell"
33
description: "This article provides a description of Web API samples that are implemented using PowerShell"
4-
ms.date: 01/20/2024
4+
ms.date: 05/14/2024
55
author: divkamath
66
ms.author: dikamath
77
ms.reviewer: jdaly
@@ -25,7 +25,7 @@ The following samples use the patterns described here:
2525
|Not available yet| [Web API Query Data Sample](web-api-query-data-sample.md)| Demonstrates how to use OData v4 query syntax and functions and Dataverse query functions. Includes examples of working with predefined queries and using FetchXML to perform queries. |
2626
|Not available yet| [Web API Conditional Operations Sample](web-api-conditional-operations-sample.md) | Demonstrates how to perform conditional operations you specify with ETag criteria.|
2727
|Not available yet|[Web API Functions and Actions Sample](web-api-functions-actions-sample.md)| Demonstrates how to use bound and unbound functions and actions, including custom actions.|
28-
|Not available yet|[Web API table schema operations sample](web-api-metadata-operations-sample.md)|Demonstrates how to perform selected operations that modify the Dataverse schema, or metadata.|
28+
|[Web API table schema operations sample (PowerShell)](samples/metadata-operations-powershell.md)|[Web API table schema operations sample](web-api-metadata-operations-sample.md)|Demonstrates how to perform selected operations that modify the Dataverse schema, or metadata.|
2929

3030

3131
## Prerequisites

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: "getEventSource (Client API reference) in model-driven apps| MicrosoftDoc
33
description: "Learn about the getEventSource method that returns a reference to the object that the event occurred on."
44
author: adrianorth
55
ms.author: aorth
6-
ms.date: 03/12/2022
6+
ms.date: 05/15/2024
77
ms.reviewer: jdaly
88
ms.topic: reference
99
applies_to: "Dynamics 365 (online)"
@@ -24,7 +24,7 @@ Returns a reference to the object that the event occurred on.
2424

2525
**Type**: Object
2626

27-
**Description**: Returns the object from the **Xrm** object model that is the source of the event, not an HTML DOM object. For example, in an [OnChange](../events/attribute-onchange.md) event, this method returns the **formContext.data.entity** object that represents the changed column.
27+
**Description**: Returns the object from the **Xrm** object model that is the source of the event, not an HTML DOM object. For example, in an [OnChange](../events/attribute-onchange.md) event, this method returns an item from the **formContext.data.entity.attributes** collection that represents the changed column.
2828

2929
[!INCLUDE[cc-terminology](../../../../data-platform/includes/cc-terminology.md)]
3030

powerapps-docs/developer/test-engine/overview.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Power Apps Test Engine overview (preview)
33
description: Learn about how you can automate tests of standalone canvas apps using the Power Apps Test Engine within Power Platform CLI.
44
author: pvillads
55
ms.author: pvillads
6-
ms.date: 08/16/2023
6+
ms.date: 05/14/2024
77
ms.reviewer: jdaly
88
ms.topic: article
99
contributors:
@@ -159,7 +159,8 @@ If you move an app that is _not_ part of a solution to a new environment, you'll
159159

160160
### See also
161161

162+
[Power Apps Test Engine release notes](https://github.com/microsoft/PowerApps-TestEngine/releases)
162163
[Power Apps Test Engine YAML format (preview)](yaml.md)
163-
[Power Apps Test Engine Power Fx functions (preview)](powerfx.md)
164+
[Power Apps Test Engine Power Fx functions (preview)](powerfx.md)
164165

165166
[!INCLUDE [footer-banner](../../includes/footer-banner.md)]

powerapps-docs/maker/TOC.yml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,8 @@
245245
href: search.md
246246
- name: Get help from a virtual agent
247247
href: ./common/virtual-agent.md
248+
- name: Copilot in Power Apps overview
249+
href: ./canvas-apps/ai-overview.md
248250
- name: Canvas apps
249251
items:
250252
- name: Canvas apps
@@ -286,10 +288,8 @@
286288
- name: Troubleshoot common errors
287289
href: ./canvas-apps/figma/common-errors.md
288290
displayName: Troubleshoot common errors when creating app from Figma
289-
- name: Create an app using AI Copilot
291+
- name: Create an app using Copilot
290292
items:
291-
- name: Overview
292-
href: ./canvas-apps/ai-overview.md
293293
- name: Create an app from conversations
294294
href: ./canvas-apps/ai-conversations-create-app.md
295295
- name: Continue editing your app with Copilot (preview)
@@ -2041,8 +2041,10 @@
20412041
href: ./data-platform/lowcode-plug-ins-examples.md
20422042
- name: Low-code plug-ins Power Fx
20432043
href: ./data-platform/low-code-plug-ins-powerfx.md
2044-
- name: Create low-code plug-ins to use with a copilot (preview)
2044+
- name: Create low-code plug-ins to use with a copilot
20452045
href: ./data-platform/low-code-plugins-copilot-studio.md
2046+
- name: Low-code plug-ins tips and known issues
2047+
href: ./data-platform/low-code-plug-ins-tips.md
20462048
- name: Work with actions
20472049
items:
20482050
- name: Use actions
@@ -2199,6 +2201,12 @@
21992201
href: ./model-driven-apps/privileges-required-customization.md
22002202
- name: API limits overview
22012203
href: ./data-platform/api-limits-overview.md
2204+
- name: Get experimental features early (preview)
2205+
items:
2206+
- name: Use the Dataverse accelerator
2207+
href: ./data-platform/dataverse-accelerator/dataverse-accelerator.md
2208+
- name: Monitor plug-ins
2209+
href: ./data-platform/dataverse-accelerator/plugin-monitoring.md
22022210
- name: For admins
22032211
items:
22042212
- name: Security in Dataverse

0 commit comments

Comments
 (0)