FetchXML 根据 Activity 状态文本对 Activity 进行排序

FetchXML to sort Activity based on Activity status Text

我需要一个可以根据 Activity 状态选项集文本对所有活动进行排序的 fetchXML。

我的 FetchXML

<fetch top='5000' >
  <entity name='task' >
    <attribute name='activityid' />
    <attribute name='statecode' />
    <attribute name='statuscodename' />
    <order attribute='statecode' />
  </entity>
</fetch>

正在按值排序。

您可以更改顺序以使用选项设置值的名称:

<fetch top='5000' >
  <entity name='task'>
    <attribute name='activityid' />
    <attribute name='statecode' />
    <attribute name='statecodename' />
    <attribute name='statuscodename' />
    <order attribute='statecodename' />
  </entity>
</fetch>