【问题标题】:CRM 2013 - What to do with FetchXML Query In JavascriptCRM 2013 - 如何处理 Javascript 中的 FetchXML 查询
【发布时间】:2014-08-22 10:47:50
【问题描述】:

我目前需要检索子网格中存在的属性,我之前的做法是使用带有 FetchXML 查询的 C# 插件来检索该属性。

但是,我想检索属性并将其上下文放入 CRM 表单上的字段中。因此,我在 JavaScript Web 资源中构建了以下内容

function getProduct()
{
var accountID = Xrm.Page.getAttribute("productid");
var AccountIDObj= accountID.getValue();

    if (AccountIDObj!=null)
    {
        AccountID= AccountIDObj[0].id;
            }

var fetch = 

"@<fetch distinct='false' mapping='logical' output-format='xml-platform' version='1.0'>
  <entity name = 'quotedetail'>
    <attribute name = 'productid'/>
    <attribute name = 'productdescription'/>
    <attribute name = 'priceperunit'/>
    <attribute name = 'quantity'/>
    <attribute name = 'extendedamount'/>
    <attribute name = 'quotedetailid'/>
  <link-entity name ='product' alias='bf' to='productid' from='productid'>
    <filter type = 'and'>
      <condition attribute='productnumber' value ='" + AccountID + "' operator = 'eq'/>
    </filter>
  <link-entity name='productpricelevel' alias='bg' to='productid' from ='productid'>
    <attribute name = 'amount'/>
   </link-entity>
  </link-entity>
</entity>
</fetch>"

我现在遇到的问题是从这里去哪里,在 C# 中我会用查询创建一个 EntityCollection 并从那里去,有人有什么建议吗?

【问题讨论】:

标签: c# javascript dynamics-crm-2013 fetchxml


【解决方案1】:

要使用 Javascript 在客户端执行 FetchXml 查询,您可以使用以下库

XrmServiceToolKit.js http://xrmservicetoolkit.codeplex.com/wikipage?title=Soap%20Functions

CrmFetchKit.js https://crmfetchkit.codeplex.com/documentation

编码愉快 :-)

【讨论】:

    猜你喜欢
    • 2016-08-09
    • 1970-01-01
    • 2013-05-19
    • 1970-01-01
    • 2012-06-16
    • 1970-01-01
    • 1970-01-01
    • 2011-08-18
    • 1970-01-01
    相关资源
    最近更新 更多