Skip to content

Commit cd035e1

Browse files
authored
Merge pull request #2858 from MicrosoftDocs/Nava_mref
Adding new sample
2 parents 6fc49fa + 3968d32 commit cd035e1

File tree

3 files changed

+54
-1
lines changed

3 files changed

+54
-1
lines changed
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
---
2+
title: "Sample: Query and detect metadata changes (Common Data Service) | Microsoft Docs" # Intent and product brand in a unique string of 43-59 chars including spaces
3+
description: "This sample shows how to query and detect metadata changes" # 115-145 characters including spaces. This abstract displays in the search result.
4+
ms.custom: ""
5+
ms.date: 05/08/2020
6+
ms.reviewer: "nabuthuk"
7+
ms.service: powerapps
8+
ms.topic: "article"
9+
author: "JimDaly" # GitHub ID
10+
ms.author: "jdaly" # MSFT alias of Microsoft employees only
11+
manager: "ryjones" # MSFT alias of manager or PM counterpart
12+
search.audienceType:
13+
- developer
14+
search.app:
15+
- PowerApps
16+
- D365CE
17+
---
18+
19+
# Query and detect metadata changes
20+
21+
22+
This sample shows how to retrieve and detect metadata changes using [RetrieveMetadataChangeRequest](https://docs.microsoft.com/dotnet/api/microsoft.xrm.sdk.messages.retrievemetadatachangesrequest?view=dynamics-general-ce-9) method. You can download the sample from [here](https://github.com/microsoft/PowerApps-Samples/tree/master/cds/orgsvc/C%23/MetadataQuery).
23+
24+
## How to run this sample
25+
26+
[!include[cc-how-to-run-samples](../../includes/cc-how-to-run-samples.md)]
27+
28+
## What this sample does
29+
30+
The `RetrieveMetadataChangeRequest` message is intended to be used in a scenario where it contains the data that is needed to retrieve a collection of metadata records that satisfy the specified criteria. The [RetrieveMetadataChangesResponse](https://docs.microsoft.com/dotnet/api/microsoft.xrm.sdk.messages.retrievemetadatachangesresponse?view=dynamics-general-ce-9) returns a timestamp value that can be used with this request at a later time to return information about how metadata has changed since the last request.
31+
32+
## How this sample works
33+
34+
To simulate the scenario described in [What this sample does](#what-this-sample-does), the sample will do the following:
35+
36+
### Setup
37+
38+
Checks for the current version of the org.
39+
40+
### Demonstrate
41+
42+
1. The `MetadataFilterExpression` method creates the filter expression to limit entities returned to non-intersect, user-owned entities not found in the list of excluded entities.
43+
2. The `MetadataConditionExpression` method returns the optionset attributes.
44+
3. The `MetadataPropertiesExpression` method limits the properties to be included with the attributes.
45+
4. The `LabelQueryExpression` method limits the labels returned to only those for user's preferred language.
46+
5. The `RetrieveMetadataChangeRequest` method retrieves the metadata for the query.
47+
48+
49+
### Clean up
50+
51+
Display an option to delete the sample data that is created in [Setup](#setup). The deletion is optional in case you want to examine the entities and data created by the sample. You can manually delete the records to achieve the same result.

powerapps-docs/developer/common-data-service/org-service/samples/toc.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,8 @@
142142
href: dump-global-option-set.md
143143
- name: Export ribbon definitions
144144
href: export-ribbon-definitions.md
145+
- name: Query and detect metadata changes
146+
href: query-metadata-changes.md
145147
- name: Retrieve valid status transitions
146148
href: retrieve-valid-status-transitions.md
147149
- name: Work with attributes

powerapps-docs/developer/component-framework/reference/paging.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ ms.assetid: 12891e96-972c-4289-bbde-2bc261cd1f12
1919

2020
## Available for
2121

22-
Model-driven apps
22+
Model-driven apps and canvas apps (public preview)
2323

2424
## Properties
2525

0 commit comments

Comments
 (0)