gpt4 book ai didi

javascript - 动态CRM2016 : cannot read property 'SetParameter' of undefined

转载 作者:行者123 更新时间:2023-12-03 04:39:53 25 4
gpt4 key购买 nike

我在帐户表单上有子网格,我正在尝试获取子联系人的订单列表,然后添加到子网格。到目前为止,我执行了以下脚本,但它抛出错误,无法读取未定义的属性“SetParameter”。谁能指导我如何更改子网格的 fetchxml?

function listOfOrders(contactId){
var orderFetchXml = "<fetch version='1.0' output-format='xml-platform' mapping='logical' distinct='false'>"+
" <entity name='salesorder'>"+
" <attribute name='name' />"+
" <attribute name='customerid' />"+
" <attribute name='salesorderid' />"+
" <attribute name='statecode' />"+
" <attribute name='createdon' />"+
" <order attribute='name' descending='false' />"+
" <filter type='and'>"+
" <condition attribute='customerid' operator='eq' uitype='contact' value='"+contactId+"' />"+
" </filter>"+
" </entity>"+
"</fetch>";

var retrievedOrders = XrmServiceToolkit.Soap.Fetch(orderFetchXml);

var contactId = "";
if(retrievedOrders.length <0)
return;

var viewId = "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX";
var viewDisName = "Account Orders subgridview";

var layOutXml = "<grid name='resultset' object='1' jump='name' select='1' icon='1' preview='1'>" +
"<row name='result' id='salesorderid'>" +
"<cell name='name' width='300' />" +
"<cell name='statecode' />"+
"<cell name='createdon' />"+
"<cell name='customerid' />"+
"disableSorting='1' />" +
"</row>" +
"</grid>";
var orderSubgrid = window.parent.document.getElementById("orderssubgrid");
//apply layout and filtered fetchXML
orderSubgrid.control.SetParameter("layoutXml", layOutXml);
orderSubgrid.control.SetParameter("fetchXml", orderFetchXml);
//Refresh grid to show filtered records only.
orderSubgrid.control.Refresh();
}

最佳答案

有一种受支持的无代码方法可以执行此操作。

  • 在联系人实体中创建一个包含订单子(monad)网格的快速 View
  • 将快速 View 添加到帐户实体,将其链接到联系人查找

如果联系人不是来自查找,您可以

  • 在帐户表单中添加对联系人的隐藏查找
  • 让您的 JavaScript 使用您想要筛选子网格的联系人的引用来填充此查找(请记住在填写字段后使用 .fireOnChange() 来调用下一步)
  • 调用 refresh() 来更新您刚刚填写的联系人查找的 onchange 中的子网格

然后像上面两点一样实现quickview。

关于javascript - 动态CRM2016 : cannot read property 'SetParameter' of undefined,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43133791/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com