Skip to content

Commit 2c0cf1a

Browse files
authored
Merge pull request #3758 from MicrosoftDocs/master
updating working
2 parents 7981486 + 9dc2e6c commit 2c0cf1a

File tree

5 files changed

+131
-11
lines changed

5 files changed

+131
-11
lines changed

powerapps-docs/developer/common-data-service/cds-sql-query.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: "Use SQL to query data (Common Data Service) | Microsoft Docs" # Intent and product brand in a unique string of 43-59 chars including spaces
33
description: "Learn how to query Common Data Service entity data using SQL." # 115-145 characters including spaces. This abstract displays in the search result.
44
ms.custom: ""
5-
ms.date: 09/25/2020
5+
ms.date: 11/09/2020
66
ms.reviewer: "pehecke"
77
ms.service: powerapps
88
ms.topic: "article"
@@ -22,9 +22,8 @@ search.app:
2222

2323
[!INCLUDE[cc-beta-prerelease-disclaimer](../../includes/cc-beta-prerelease-disclaimer.md)]
2424

25-
> [!WARNING]
26-
> A problem has been identified with the Tabular Data Stream (TDS) endpoint. This feature is presently globally disabled as we work to address a security issue. A fix for the issue has been developed. Deployment of the fix and feature re-enablement to all public regions is planned for the first week of November 2020. A safe deployment practice is being followed so the feature may be available in your region earlier. Thank you for your patience on this matter.
27-
25+
> [!IMPORTANT]
26+
> This feature has been re-enabled in the majority of regions. Please resume testing, and provide feedback. We thank you for your patience and feedback.
2827
2928

3029
A SQL data connection is available on the Common Data Service endpoint. The SQL connection provides read-only access to the entity data of the target Common Data Service environment. This allows you to write and execute SQL queries against the entity data table. Table columns provide the attribute data of the entity. No custom views of the data have been provided.

powerapps-docs/developer/model-driven-apps/clientapi/reference/Xrm-Utility/invokeProcessAction.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ For more information about actions, see [Use actions](/powerapps/maker/common-da
3737

3838
## Returns
3939

40-
On success, returns Web API result along with any action output.
40+
On success, returns an object with the Web API result along with any action output.
41+
On failure, returns an object with error details.
4142

4243
### Related topics
4344
[Use actions](/powerapps/maker/common-data-service/actions)

powerapps-docs/developer/model-driven-apps/clientapi/reference/Xrm-WebApi/online/execute.md

Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -523,6 +523,126 @@ Xrm.WebApi.online.execute(deleteRequest).then(
523523
);
524524
```
525525

526+
### Associate a record
527+
The following code sample demonstrates how to perform an Associate operation on collection-valued navigation properties (Many-To-One and Many-To-Many relationships). For single-valued navigation properties (One-To-Many relationships a.k.a Lookup fields), you can perform an Update operation as shown above or use [Xrm.WebApi.updateRecord](../updateRecord.md).
528+
529+
```JavaScript
530+
var Sdk = window.Sdk || {};
531+
532+
/*
533+
* Request to execute an Associate operation.
534+
*/
535+
Sdk.AssociateRequest = function(target, relatedEntities, relationship) {
536+
this.target = target;
537+
this.relatedEntities = relatedEntities;
538+
this.relationship = relationship;
539+
};
540+
541+
// NOTE: The getMetadata property should be attached to the function prototype instead of the
542+
// function object itself.
543+
Sdk.AssociateRequest.prototype.getMetadata = function() {
544+
return {
545+
boundParameter: null,
546+
parameterTypes: {},
547+
operationType: 2, // Associate and Disassociate fall under the CRUD umbrella
548+
operationName: "Associate"
549+
}
550+
};
551+
552+
// Construct the target EntityReference object
553+
var target = {
554+
entityType: "account",
555+
id: "0b4abc7d-7619-eb11-8dff-000d3ac5c7f9"
556+
};
557+
558+
// Construct the related EntityReferences that the Target will be associated with.
559+
var relatedEntities = [
560+
{
561+
entityType: "contact",
562+
id: "180a9aad-7619-eb11-8dff-000d3ac5c7f9"
563+
},
564+
{
565+
entityType: "contact",
566+
id: "753c58b4-7619-eb11-8dff-000d3ac5c7f9"
567+
}
568+
];
569+
570+
// The name of the existing relationship to associate on.
571+
var relationship = "new_account_contact";
572+
573+
var manyToManyAssociateRequest = new Sdk.AssociateRequest(target, relatedEntities, relationship)
574+
575+
Xrm.WebApi.online.execute(manyToManyAssociateRequest).then(
576+
function(result) {
577+
if (result.ok) {
578+
console.log("Status: %s %s", result.status, result.statusText);
579+
// perform other operations as required;
580+
}
581+
},
582+
function(error) {
583+
console.log(error.message);
584+
// handle error conditions
585+
}
586+
);
587+
```
588+
589+
### Disassociate a record
590+
The following code sample demonstrates how to perform a Disassociate operation on collection-valued navigation properties (Many-To-One and Many-To-Many relationships). For single-valued navigation properties (One-To-Many relationships a.k.a Lookup fields), you can perform an Update operation as shown above or use [Xrm.WebApi.updateRecord](../updateRecord.md).
591+
592+
> [!NOTE]
593+
> Unlike the Associate operation which allows associating the target entity record with multiple related entity records in a single operation, the Disassociate operation is limited to only disassociating one entity record from the target entity record per operation.
594+
595+
```JavaScript
596+
var Sdk = window.Sdk || {};
597+
598+
/*
599+
* Request to execute a Disassociate operation.
600+
*/
601+
Sdk.DisassociateRequest = function(target, relatedEntityId, relationship) {
602+
this.target = target;
603+
this.relatedEntityId = relatedEntityId;
604+
this.relationship = relationship;
605+
};
606+
607+
// NOTE: The getMetadata property should be attached to the function prototype instead of the
608+
// function object itself.
609+
Sdk.DisassociateRequest.prototype.getMetadata = function() {
610+
return {
611+
boundParameter: null,
612+
parameterTypes: {},
613+
operationType: 2, // Associate and Disassociate fall under the CRUD umbrella
614+
operationName: "Disassociate"
615+
}
616+
};
617+
618+
// Construct the target EntityReference object
619+
var target = {
620+
entityType: "account",
621+
id: "0b4abc7d-7619-eb11-8dff-000d3ac5c7f9"
622+
};
623+
624+
// The GUID of the related entity record to disassociate.
625+
var relatedEntityId = "180a9aad-7619-eb11-8dff-000d3ac5c7f9";
626+
627+
// The name of the existing relationship to disassociate from.
628+
var relationship = "new_account_contact";
629+
630+
var manyToManyDisassociateRequest = new Sdk.DisassociateRequest(target, relatedEntityId, relationship)
631+
632+
Xrm.WebApi.online.execute(manyToManyDisassociateRequest).then(
633+
function(result) {
634+
if (result.ok) {
635+
console.log("Status: %s %s", result.status, result.statusText);
636+
// perform other operations as required;
637+
}
638+
},
639+
function(error) {
640+
console.log(error.message);
641+
// handle error conditions
642+
}
643+
);
644+
```
645+
526646
### Related topics
527647

528648

powerapps-docs/developer/model-driven-apps/clientapi/reference/Xrm-WebApi/updateRecord.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,9 @@ Xrm.WebApi.updateRecord("task", "5531d753-95af-e711-a94e-000d3a11e605", data).th
208208
);
209209
```
210210

211+
### Update associations for collection-valued navigation properties
212+
The [Xrm.WebApi.online.execute](online/execute.md) API can be used to associate and disassociate collection-valued navigation properties. This is **NOT** supported for mobile offline scenarios.
213+
211214
### Related topics
212215

213216
[Xrm.WebApi](../xrm-webapi.md)

powerapps-docs/maker/common-data-service/view-entity-data-power-bi.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: "View entity data in Power BI Desktop (Preview) | MicrosoftDocs"
33
description: "Learn how access and view entity data in Power BI Desktop"
44
ms.custom: ""
5-
ms.date: 09/25/2020
5+
ms.date: 11/09/2020
66
ms.reviewer: "matp"
77
ms.service: powerapps
88
author: "Mattp123"
@@ -21,11 +21,8 @@ search.app:
2121

2222
[!INCLUDE [cc-beta-prerelease-disclaimer](../../includes/cc-beta-prerelease-disclaimer.md)]
2323

24-
> [!WARNING]
25-
> A problem has been identified with the Tabular Data Stream (TDS) endpoint. This feature is globally disabled, and we are working urgently to address the issue.
26-
> A fix for the issue found is being being deployed. It will be deployed and the feature re-enabled to all public regions the first week of November. The safe deployment practice is being followed so the feature may be available in your region earlier. Thank you for your patience.
27-
>
28-
> While this feature is disabled, the existing Common Data Service connector still works using the import connection mode.
24+
> [!IMPORTANT]
25+
> This feature has been re-enabled in the majority of regions. Please resume testing, and provide feedback. We thank you for your patience and feedback.
2926
3027
You can use Power BI Desktop to view entities in Common Data Service. The entity
3128
record data that you can access from your environment is read-only. Data access

0 commit comments

Comments
 (0)