简体   繁体   English

从ASPX模式页面刷新Dynamics CRM 2013网格

[英]Refresh Dynamics CRM 2013 grid from aspx modal page

I am trying to write a custom plugin for Microsoft Dynamics CRM 2013. We are running On Premises. 我正在尝试为Microsoft Dynamics CRM 2013编写自定义插件。我们正在本地运行。 I created a custom c# web project to add Products to a Quote more quickly. 我创建了一个自定义c#Web项目,以更快地将产品添加到报价中。 The web page is launched as a modal page from the ribbon. 该网页从功能区作为模式页面启动。 (I used the Ribbon Workbench 2013). (我使用了Ribbon Workbench 2013)。 All back-end functionality works fine on the new modal form, but as I add Products to the Quote I would like the Product sub-grid on the Quote form to refresh Automatically. 在新的模式窗体上,所有后端功能都可以正常工作,但是当我将产品添加到报价单时,我希望“报价单”窗体上的“产品”子网格可以自动刷新。

Did you try "refresh" method of "Xrm.Page.ui.controls"? 您是否尝试过“ Xrm.Page.ui.controls”的“刷新”方法?

Like: 喜欢:

var ctrl = Xrm.Page.ui.controls.get("SubGridName");
ctrl.refresh();

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

By clicking a button you must execute a custom javascript code. 通过单击按钮,您必须执行自定义javascript代码。 After closing modal window add code specified above. 关闭模态窗口后,添加上面指定的代码。

UPD. UPD。

1) We need to create "JScript" web resource ("/script/myCustomScript.js") 1)我们需要创建“ JScript” Web资源(“ /script/myCustomScript.js”)

Like that: 像那样:

function onClickRibbonButton1()
{    
    // show modal dialog
    window.showModalDialog('https://serverurl/custompage.html');
    // after closing - refresh sub grid
    var ctrl = Xrm.Page.ui.controls.get("SubGridName");
    ctrl.refresh(); 
}

2) In Workbench specify following: 2)在工作台中指定以下内容:

色带工作台

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM