Я пытаюсь предоставить возможность быстрой фильтрации для пользователей Microsoft Dynamics CRM, которая позволяет им быстро подфильтровать представление домашней страницы.
Требование клиента состоит в том, чтобы обеспечить более простую работу, чем то, что позволяют фильтры, поэтому я добавил кнопку, которая запускает веб-ресурс HTML для сбора их критериев поиска. Он использует их ввод для создания выборки XML, а затем передает их обратно в сетку на главной странице. Это работало до UCI, но больше не работает с UCI. Код в моем HTML веб-ресурсе, похоже, не может «найти» элемент управления или поместить на него sh XML.
Мой предыдущий ресурс HTML использовал что-то похожее на следующий скрипт для создания XML и pu sh на домашней странице учетной записи:
var city = "Tampa"; //this input is obtained from the user input in the actual HTML
var fetchType ='<condition attribute="new_orgtype" operator="in"><value>1</value><value>2</value><value>5</value></condition>';
var cityXML = '<condition attribute="address1_city" operator="like" value="'+city+'%"/>';
//concatenate input into a complete fetch XML
var effectiveFetchXml = '<fetch distinct="false" useraworderby="false" no-lock="false" mapping="logical" page="1" count="250" returntotalrecordcount="true"><entity name="account"><attribute name="name" /><attribute name="address1_city" /><attribute name="primarycontactid" /><attribute name="telephone1" /><attribute name="address1_stateorprovince" /><attribute name="parentaccountid" /><attribute name="address1_line1" /><attribute name="websiteurl" /><attribute name="fax" /><attribute name="address1_postalcode" /><attribute name="accountid" /><attribute name="name" /><attribute name="parentaccountid" /><attribute name="primarycontactid" /><attribute name="telephone1" /><attribute name="fax" /><attribute name="websiteurl" /><attribute name="address1_line1" /><attribute name="address1_city" /><attribute name="address1_stateorprovince" /><attribute name="address1_postalcode" /><filter type="and"><condition attribute="statecode" operator="eq" value="0" />'+fetchType+cityXML+'</filter><order attribute="name" descending="false" /></entity></fetch>';
//identify the grid on the main page
var grid = window.opener.document.getElementById("crmGrid");
//Inject the new fetchXml
grid.control.SetParameter("fetchXml", effectiveFetchXml);
grid.control.SetParameter("effectiveFetchXml", effectiveFetchXml);
//Force the subgrid to Refresh
grid.control.Refresh();