FetchXML - Sort rows based on linked entity attribute #42
-
Hi, I have a fetchXML query and customer wants to have records ordered by attributes (city and street) from linked entity. In fetch you can't set the sequence in which order is applied. Root entity (talxis_site) is ordered first, even when no order is specified. Then first linked entity, second linked entity, etc. Essentially, I would need cross-entity ordering, but I don't think it is supported. This is my current fetch (simplified) <fetch version="1.0" output-format="xml-platform" mapping="logical" >
<entity name="talxis_site" >
<attribute name="talxis_internalid" />
<attribute name="talxis_name" />
<attribute name="talxis_addressid" />
<link-entity name="talxis_address" from="talxis_addressid" to="talxis_addressid" >
<attribute name="talxis_city" />
<attribute name="talxis_line1" />
<order attribute="talxis_city" />
<order attribute="talxis_line1" />
</link-entity>
</entity>
</fetch> I have tried ordering root entity using alias of linked one, but that is not supported either <fetch version="1.0" output-format="xml-platform" mapping="logical" >
<entity name="talxis_site" >
<attribute name="talxis_internalid" />
<attribute name="talxis_name" />
<attribute name="talxis_addressid" />
<order attribute="address.talxis_city" />
<link-entity name="talxis_address" from="talxis_addressid" to="talxis_addressid" alias="address" >
<attribute name="talxis_city" />
</link-entity>
</entity>
</fetch> You can also set aliases to attributes, but that also didn't work. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I guess there was something wrong with my device, but after restart of fetch builder, I copied the same query I posted and the order started working as I hoped. |
Beta Was this translation helpful? Give feedback.
I guess there was something wrong with my device, but after restart of fetch builder, I copied the same query I posted and the order started working as I hoped.