Skip to content

Commit 94054ac

Browse files
authored
Merge branch 'main' into marcel-YAML
2 parents f69308f + 0a9f374 commit 94054ac

File tree

49 files changed

+18903
-166
lines changed

Some content is hidden

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

49 files changed

+18903
-166
lines changed

powerapps-docs/developer/data-platform/customer-entities-account-contact.md

Lines changed: 435 additions & 44 deletions
Large diffs are not rendered by default.

powerapps-docs/developer/data-platform/how-dataverse-sql-differs-from-transact-sql.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,6 @@ More information: [Transact-SQL statements](/sql/t-sql/statements/statements)
9292
- PIVOT and UNPIVOT
9393
- [GROUP BY](#select-group-by)/Having
9494
- General
95-
- IF THEN ELSE
9695
- DECLARE variable
9796

9897
### [Not supported](#tab/not-supported)
@@ -111,6 +110,7 @@ More information: [Transact-SQL statements](/sql/t-sql/statements/statements)
111110
- Without unique column name and alias
112111
- General
113112
- WHILE LOOP
113+
- IF THEN ELSE
114114

115115
---
116116

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/limits-and-config.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ This list identifies all services to which Power Apps communicates and their usa
114114
| ris.api.iris.microsoft.com<br>eudb.ris.api.iris.microsoft.com | https | Record user action in response to Power Apps in-app campaigns |
115115
| arc.msn.com<br>arc-emea.msn.com | https | Record user viewing of Power Apps in-app campaigns |
116116
| *.hubblecontent.osi.office.net<br>hubble.officeapps.live.com<br>res.cdn.office.net |https |Provides stock images to use in your app |
117+
| dc.services.visualstudio.com | https | [Application Insights](/azure/azure-monitor/app/app-insights-overview) endpoint used for [custom telemetry in canvas app](maker/canvas-apps/application-insights.md) |
117118

118119
<sup>1</sup> Replaces ___domain name `gov.content.powerapps.us` used prior to July 2022. <br>
119120
<sup>2</sup> Replaces ___domain name `high.content.powerapps.us` used prior to July 2022. <br>
@@ -158,7 +159,7 @@ Power Apps does not support running with a proxy enabled. This can cause unpredi
158159

159160
For canvas app data type limits, you can find information about size limits on text, hyperlinks, images, and media in [Data types in Power Apps](/power-platform/power-fx/data-types#text-hyperlink-image-and-media).
160161

161-
For Microsoft Dataverse data type size limits, you can find information on column types, such as text and image columns, in [Types of columns](maker/data-platform/types-of-fields.md).
162+
For Microsoft Dataverse data type size limits, you can find information on column types, such as text and image columns, in [Types of columns](/maker/data-platform/types-of-fields.md).
162163

163164
## Power Apps per app plan
164165

powerapps-docs/maker/TOC.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@
5353
href: ../user/app-source.md
5454
- name: Draft well-written, input text with Copilot (preview)
5555
href: ../user/well-written-input-text-copilot.md
56+
- name: Filter, sort, and search galleries with Copilot (preview)
57+
href: ../user/smartGrid.md
5658
- name: 'Use model-driven apps'
5759
items:
5860
- name: Overview
@@ -518,6 +520,8 @@
518520
href: ./canvas-apps/controls/modern-controls/modern-control-slider.md
519521
- name: Tabs or tab list
520522
href: ./canvas-apps/controls/modern-controls/modern-control-tabs-or-tabs-list.md
523+
- name: Avatar (preview)
524+
href: ./canvas-apps/controls/modern-controls/modern-control-avatar.md
521525
- name: Badge (preview)
522526
href: ./canvas-apps/controls/modern-controls/modern-controls-badge.md
523527
- name: Checkbox (preview)
@@ -2203,6 +2207,12 @@
22032207
href: ./model-driven-apps/privileges-required-customization.md
22042208
- name: API limits overview
22052209
href: ./data-platform/api-limits-overview.md
2210+
- name: Get experimental features early (preview)
2211+
items:
2212+
- name: Use the Dataverse accelerator
2213+
href: ./data-platform/dataverse-accelerator/dataverse-accelerator.md
2214+
- name: Monitor plug-ins
2215+
href: ./data-platform/dataverse-accelerator/plugin-monitoring.md
22062216
- name: For admins
22072217
items:
22082218
- name: Security in Dataverse
@@ -2225,6 +2235,8 @@
22252235
href: ./data-platform/azure-synapse-link-troubleshooting-guide.md
22262236
- name: Receive Azure Synapse Link for Dataverse notifications
22272237
href: ./data-platform/azure-synapse-link-notifications.md
2238+
- name: Transtion from legacy data generation services
2239+
href: ./data-platform/azure-synapse-link-transition-from-FnO.md
22282240
- name: FAQ about Azure Synapse Link
22292241
href: ./data-platform/export-data-lake-faq.yml
22302242
- name: Application Lifecycle Management

0 commit comments

Comments
 (0)