CI-D Measure dependency on Dataverse

Gustaf WesterlundDyn365CE2 months ago23 Views

When measures are created in CI-D to be used in CI-J there are dependencies created which will stop you from removing the measure. CI-D is not very helpful in telling you how to remove it. I will try to be a bit more helpful.

When trying to remove the Measure this is the error I got:

Error: Detected DataVerse dependencies in Measure: ListMemberships. Please delete these dependencies and merge again.
Request ID: 14056846-b9c1-4ec8-98c2-88778e518b88
Time: 2024-12-05, 11:12:10

My investigation below with the help of Microsoft Support lead me to the understanding according to the image above. As you can see dependency is actually sort of circular, or at least one part of the dependency (dependent component) is at the entityanalytics on the record which points to msdynci_listmemberships, on the other hand (required component) on the table msdynci_listmemberships.

The fix, is to remove the record in entityanalytics. Easiest way in this case, is to just use a browser console where you are logged into the right Dynamics.

To remove the entityanalytics record that is blocking this:

Xrm.WebApi.deleteRecord('entityanalyticsconfig', 'fc105928-3170-ef11-a671-000d3a64e5b5')

After this I was able to remove the measure in CI-D.

Below I will detail the steps I did to understand this.

The first step is to look in the table “entityanalyticsconfig” searching for the name of the Measure. Its name is “msdynci_” + name of the measure. Check out the metadata if you are unsure.

<fetch top="50">
  <entity name="entityanalyticsconfig">
    <filter>
      <condition attribute="parententitylogicalname" operator="eq" value="msdynci_listmemberships" />
    </filter>
  </entity>
</fetch>
{
  "value": [
    {
      "isenabledforadls": true,
      "parententityid": "dd7613fe-806e-ef11-a670-000d3ad82e35",
      "modifiedon": "2024-09-11T11:29:54Z",
      "componentidunique": "807e7e6d-71f5-446a-8009-437cbf5a922a",
      "isenabledfortimeseries": false,
      "versionnumber": 15487568487,
      "parententitylogicalname": "msdynci_listmemberships",
      "entityanalyticsconfigid": "fc105928-3170-ef11-a671-000d3a64e5b5",
      "componentstate": 0,
      "organizationid": "ba0a9fa5-462b-45cc-b603-e9b16acd63c4",
      "solutionid": "fd140aae-4df4-11dd-bd17-0019b9312238"
    }
  ]
}

As you can see above the id is fc105928-3170-ef11-a671-000d3a64e5b5. This is the record I did the removal on above.

To further understand the dependency record for this, let’s dig into that table, searching for a record with this id.

<fetch top="50">
  <entity name="dependency">
    <attribute name="dependencyid" />
    <attribute name="dependencytype" />
    <filter>
      <condition entityname="dcn" attribute="objectid" operator="eq" value="fc105928-3170-ef11-a671-000d3a64e5b5" />
    </filter>
    <link-entity name="dependencynode" from="dependencynodeid" to="dependentcomponentnodeid" link-type="inner" alias="dcn">
      <attribute name="componenttype" />
      <attribute name="objectid" />
      <attribute name="parentid" />
    </link-entity>
    <link-entity name="dependencynode" from="dependencynodeid" to="requiredcomponentnodeid" link-type="inner" alias="rcn">
      <attribute name="componenttype" />
      <attribute name="objectid" />
      <attribute name="parentid" />
    </link-entity>
  </entity>
</fetch>
{
  "value": [
    {
      "rcn.componenttype": 1,
      "rcn.parentid": "00000000-0000-0000-0000-000000000000",
      "dcn.parentid": "00000000-0000-0000-0000-000000000000",
      "dcn.objectid": "fc105928-3170-ef11-a671-000d3a64e5b5",
      "dependencyid": "e46e52db-46a7-4585-8a6a-6ba888a5bd1f",
      "dcn.componenttype": 430,
      "rcn.objectid": "dd7613fe-806e-ef11-a670-000d3ad82e35",
      "dependencytype": 2
    }
  ]
}

The result shows us that the required component id is: dd7613fe-806e-ef11-a670-000d3ad82e35 which is of type: 1.

By checking this table in Microsoft Learn, we can see what this is: (both link and table)

By searching the table called “entity” for 430, we can find what table this represents:

https://learn.microsoft.com/en-us/power-apps/developer/data-platform/webapi/reference/dependency?view=dataverse-latest

Values Label
1 Entity
2 Attribute
3 Relationship
4 Attribute Picklist Value
5 Attribute Lookup Value
6 View Attribute
7 Localized Label
8 Relationship Extra Condition
9 Option Set
10 Entity Relationship
11 Entity Relationship Role
12 Entity Relationship Relationships
13 Managed Property
14 Entity Key
16 Privilege
17 PrivilegeObjectTypeCode
20 Role
21 Role Privilege
22 Display String
23 Display String Map
24 Form
25 Organization
26 Saved Query
29 Workflow
31 Report
32 Report Entity
33 Report Category
34 Report Visibility
35 Attachment
36 Email Template
37 Contract Template
38 KB Article Template
39 Mail Merge Template
44 Duplicate Rule
45 Duplicate Rule Condition
46 Entity Map
47 Attribute Map
48 Ribbon Command
49 Ribbon Context Group
50 Ribbon Customization
52 Ribbon Rule
53 Ribbon Tab To Command Map
55 Ribbon Diff
59 Saved Query Visualization
60 System Form
61 Web Resource
62 Site Map
63 Connection Role
64 Complex Control
70 Field Security Profile
71 Field Permission
90 Plugin Type
91 Plugin Assembly
92 SDK Message Processing Step
93 SDK Message Processing Step Image
95 Service Endpoint
150 Routing Rule
151 Routing Rule Item
152 SLA
153 SLA Item
154 Convert Rule
155 Convert Rule Item
65 Hierarchy Rule
161 Mobile Offline Profile
162 Mobile Offline Profile Item
165 Similarity Rule
66 Custom Control
68 Custom Control Default Config
166 Data Source Mapping
201 SDKMessage
202 SDKMessageFilter
203 SdkMessagePair
204 SdkMessageRequest
205 SdkMessageRequestField
206 SdkMessageResponse
207 SdkMessageResponseField
210 WebWizard
18 Index
208 Import Map
300 Canvas App
371 Connector
372 Connector
380 Environment Variable Definition
381 Environment Variable Value
400 AI Project Type
401 AI Project
402 AI Configuration
430 Entity Analytics Configuration
431 Attribute Image Configuration
432 Entity Image Configuration
<fetch top="50">
  <entity name="entity">
    <attribute name="logicalname" />
    <filter>
      <condition attribute="entityid" operator="eq" value="dd7613fe-806e-ef11-a670-000d3ad82e35" />
    </filter>
  </entity>
</fetch>
{
  "value": [
    {
      "logicalname": "msdynci_listmemberships",
      "entityid": "dd7613fe-806e-ef11-a670-000d3ad82e35"
    }
  ]
}

Hence, from this I generated the image above. Since it is something of a circular reference, Microsoft Support suggested that I remove the entity analytics record with id: e46e52db-46a7-4585-8a6a-6ba888a5bd1f. However, not entirely sure what this is and hence I tried the one I had gotten in the first steps above, and that worked.

Generally I think it is a good idea to investigate what the dependencies point to, before removing something. In this case the dependency record in itself wasn’t removed, only the dependent part.

Thanks to Microsoft support for helping out with this and I hope it might shed some insights if you are having similar issues. I also think breaking down the dependency table in a tool in for instance XrmToolBox would be a great idea. I have a bit of a bad conscience for BulkDeleteManager that I own and I am not giving enough love, so feel free to build it based on this and I guess some more stuff. I will be happy to help out the the investigations if you are willing to build it.

Original Post https://powerplatform.se/ci-d-measure-dependency-on-dataverse/

0 Votes: 0 Upvotes, 0 Downvotes (0 Points)

Leave a reply

Follow
Sign In/Sign Up Sidebar Search
Popular Now
Loading

Signing-in 3 seconds...

Signing-up 3 seconds...