Fetch XML: Conditions are not supported on Link entities

Sarthak Behera 0 Reputation points
2024-02-11T13:30:01.4733333+00:00

Data type is Choice for the msdyn_energytype attribute in dataverse. Only using <attribute name="msdyn_energytype" /> in the fetchXML is returning the Integer value instead of the label. Therefore, I'm trying to create a link-entity with stringmap (which has the choice details). However, I'm getting an error that says Conditions are not supported on Link entities.

<fetch>
  <entity name="msdyn_purchasedenergy">
    <attribute name="msdyn_name" />
    <link-entity name="stringmap" from="attributevalue" to="msdyn_energytype" link-type="outer" alias="sm" visible="true">
      <attribute name="value" />
      <filter>
        <condition attribute="attributename" operator="eq" value="msdyn_energytype" />
      </filter>
    </link-entity>
  </entity>
</fetch>

Entire call stack is as follows: Call Stack

I have created a similar query (snippet below) for another entity but it works fine.

<fetch>
	<!-- Entity: Organizational hierarchy -->
	<entity name="msdyn_sustainabilityorganizationalhierarchy">
		<!-- Organizational unit -->
        <link-entity name="msdyn_sustainabilityorganizationalunit" from="msdyn_sustainabilityorganizationalunitid" to="msdyn_organizationalunitid" link-type="outer" alias="msdyn_sustainabilityorganizationalunit">
			<attribute name="msdyn_name" />
			<!-- Organizational unit type-->
            <link-entity name="stringmap" from="attributevalue" to="msdyn_organizationalunittype" link-type="inner" alias="stringmap" visible="true">
        		<attribute name="value" />
        		<filter>
          			<condition attribute="attributename" operator="eq" value="msdyn_organizationalunittype" />
        		</filter>
      		</link-entity>
		</link-entity>
	</entity>
</fetch>

Please advise on what can be changed in the xml query for msdyn_purchasedenergy entity to resolve this issue. I'm using this query in a copy activity of ADF

Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
9,125 questions
{count} votes