我正在使用以下2个查询从Dynamic 365使用其Web API检索帐户记录列表:
https://<CRM URL>/api/data/v8.2/accounts?$orderby=accountid asc&$select=accountid,name
和
https://<CRM URL>/api/data/v8.2/accounts?$orderby=accountid desc&$select=accountid,name
我预计第一个查询将按名称属性按升序排列所有帐户记录,而第二个查询将获取按名称属性按降序排序的所有记录。但是,在两个查询中,某些记录都没有排序。
我正在使用Dynamic 365 Online,版本1612(8.2.2.111)。
我还尝试使用以下查询进行团队实体,但结果按升序排序。
https://<CRM URL>/api/data/v8.2/teams?$orderby=name desc&$select=teamid,name
团队的示例数据:
{
"@odata.etag": "W/\"897395\"",
"teamid": "7a526c62-f4ae-e711-8107-480fcff22781",
"name": "TeamTest2",
"ownerid": "7a526c62-f4ae-e711-8107-480fcff22781"
},
{
"@odata.etag": "W/\"894834\"",
"teamid": "58ab8076-f4ae-e711-8107-480fcff22781",
"name": "TestingPl13",
"ownerid": "58ab8076-f4ae-e711-8107-480fcff22781"
},
{
"@odata.etag": "W/\"897396\"",
"teamid": "8e4fcd11-53aa-e711-8105-70106fa1c9b1",
"name": "TeamTest3",
"ownerid": "8e4fcd11-53aa-e711-8105-70106fa1c9b1"
},
{
"@odata.etag": "W/\"894835\"",
"teamid": "be7da7fb-178f-e711-8118-c4346bc51078",
"name": "kalinin-staging",
"ownerid": "be7da7fb-178f-e711-8118-c4346bc51078"
}
预期结果:
{
"@odata.etag": "W/\"894834\"",
"teamid": "58ab8076-f4ae-e711-8107-480fcff22781",
"name": "TestingPl13",
"ownerid": "58ab8076-f4ae-e711-8107-480fcff22781"
},
{
"@odata.etag": "W/\"897396\"",
"teamid": "8e4fcd11-53aa-e711-8105-70106fa1c9b1",
"name": "TeamTest3",
"ownerid": "8e4fcd11-53aa-e711-8105-70106fa1c9b1"
},
{
"@odata.etag": "W/\"897395\"",
"teamid": "7a526c62-f4ae-e711-8107-480fcff22781",
"name": "TeamTest2",
"ownerid": "7a526c62-f4ae-e711-8107-480fcff22781"
},
{
"@odata.etag": "W/\"894835\"",
"teamid": "be7da7fb-178f-e711-8118-c4346bc51078",
"name": "kalinin-staging",
"ownerid": "be7da7fb-178f-e711-8118-c4346bc51078"
}
实际结果
{
"@odata.etag": "W/\"897395\"",
"teamid": "7a526c62-f4ae-e711-8107-480fcff22781",
"name": "TeamTest2",
"ownerid": "7a526c62-f4ae-e711-8107-480fcff22781"
},
{
"@odata.etag": "W/\"894834\"",
"teamid": "58ab8076-f4ae-e711-8107-480fcff22781",
"name": "TestingPl13",
"ownerid": "58ab8076-f4ae-e711-8107-480fcff22781"
},
{
"@odata.etag": "W/\"897396\"",
"teamid": "8e4fcd11-53aa-e711-8105-70106fa1c9b1",
"name": "TeamTest3",
"ownerid": "8e4fcd11-53aa-e711-8105-70106fa1c9b1"
},
{
"@odata.etag": "W/\"894835\"",
"teamid": "be7da7fb-178f-e711-8118-c4346bc51078",
"name": "kalinin-staging",
"ownerid": "be7da7fb-178f-e711-8118-c4346bc51078"
}
似乎只是TeamTest2没有被排序,但我仍然无法找到原因。