【问题标题】:RetrieveMultipleRequest & Service.Retrievemultiple - When and Why?RetrieveMultipleRequest 和 Service.Retrievemultiple - 何时以及为什么?
【发布时间】:2012-02-24 08:59:02
【问题描述】:

正如标题所示,

我们何时以及为什么要使用 RetrieveMultipleRequest 而不是 Service.Retrievemultiple?

能否请我提供一种或两种情况,其中一种比另一种更可取?

我的理解是 RetrieveMultipleRequest 类似于进行 FetchXML 查询(实际上可以使用 FetchXML 而不是查询表达式)。

是这个原因吗?如果是这样,您可以在 FetchXML 查询中执行哪些在 QueryExpression 中无法执行的操作?

【问题讨论】:

    标签: dynamics-crm dynamics-crm-2011


    【解决方案1】:

    根据CRM 3.0 docs

    CrmService(CRM 2011 中的 IOrganizationService)包含一组许多实体共有的方法。

    所以IOrganizationService 接口的RetrieveMultiple 方法是RetrieveMultipleRequestRetrieveMultipleResponse 操作对的快捷方法。这在查看documentation for the RetriveMultipleRequest class on MSDN 时最为明显:文档中的示例引用了IOrganizationServiceRetrieveMultiple 方法,不是RetrieveMultipleRequestRetrieveMultipleResponse 类,这也表明Microsoft 打算将两者互换。

    因为它们是可互换的,您可以FetchXml 传递给RetrieveMultiple 方法。请参阅 Anwar's answersimilar question,了解如何以及为何使用 FetchXml

    【讨论】:

      【解决方案2】:

      RetrieveMultiple 方法创建 RetrieveMultipleRequest 类的实例并将其发送到服务器。没有特殊目的直接使用RetrieveMultipleClass。

      【讨论】:

        猜你喜欢
        • 2013-06-13
        • 2021-01-24
        • 2013-01-05
        • 2017-03-30
        • 2017-05-28
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多