CRM动态:oData字符串javascript [英] CRM dynamics: oData string javascript

查看:95
本文介绍了CRM动态:oData字符串javascript的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

想象两个表:

TABLE A           |TABLE B
Entity            |Id
Id                |name
Points            |Ranking           

如何通过$ expand使用orderby:

How to use orderby with $expand:

$select=Entity,Id,Points,A_B/name&$orderby=Id asc&$expand=A_B

如何按表B中的排名进行订购?我尝试过:

How can i order by Ranking which is from TABLE B? I've tried:

$select=Entity,Id,Points,A_B/name,A_B/Ranking&$orderby=A_B/Ranking asc&$expand=A_B

不起作用 发生以下错误:

Not working It occurs the following error:

:: Error : 500: Internal Server Error: The expression 'IIF((Convert(value(Microsoft.Crm.Extensibility.OrganizationDataServiceVisitingQueryProvider).GetValue(p, value(System.Data.Services.Providers.ResourceProperty))) == null), null,  

这是什么意思?

推荐答案

您可以使用$ expand将表B连接到ODATA查询,但不幸的是,您只能对主实体进行排序.

You can join table B to your ODATA query by using $expand, but unfortunately you can only sort on the primary entity.

您可以对扩展的实体进行过滤,因此可能会颠倒您的逻辑并从B联接中选择A,对B进行排序,然后对A进行过滤.

You can filter on the expanded entity, so you could potentially reverse your logic and select from B join to A, order on B and then filter on A.

http://blogs.msdn.com/b/crm/archive/2011/03/02/using-odata-retrieve-in-microsoft-dynamics-crm-2011.aspx?Redirected=是

http://msdn.microsoft.com/en-us/library/gg309461.aspx

如果发现OData端点受到限制,则始终可以选择使用FetchXML.我使用 https://github.com/paul-way/JCL ,但在Codeplex上还有其他提供更多功能.我写了JCL,所以我很偏心.

If you find the OData endpoint to be limiting, you can always opt to use FetchXML. I use https://github.com/paul-way/JCL but there are others on codeplex that offer more functionality. I wrote JCL, so I'm partial.

这篇关于CRM动态:oData字符串javascript的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆