refresh - 在 Dynamics 365 CRM 统一接口中重新加载/刷新子网格时重新加载表单的问题
问题描述
我有与这个线程完全相同的场景: Reload Form on reload/refresh of subgrid in Dynamics 365 CRM Unified Interface
不幸的是,建议的解决方案对我不起作用。唯一一次调用“subgridEventListener”方法是在表单加载时。如果我从子网格中添加或删除记录,则不会发生任何事情..
有没有人可以解决这个问题?
统一接口。2019 年发布第 2 波启用服务器版本:9.1.0000.16843 客户端版本:1.4.583-2004.2 –</p>
解决方案
//On load of main form event
function OnloadOfMainForm(executionContext) {
// call onLoad of subgrid function
SubgridEventHandler(executionContext);
}
var globalFormContext;
function SubgridEventHandler(executionContext){
//make formContext as global
globalFormContext = executionContext.getFormContext();
var gridContext = globalFormContext.getControl("subgrid_name");
//Verify the subgrid is loaded, if not recursively call function again
if (gridContext != null && gridContext != undefined){
//don't try to pass formEontext some time it doesn't works
gridContext.addOnLoad(SubgridFunctionExe);
}else{
setTimeout(function () { SubgridEventHandler(); }, 200);
}
}
//Perform operation onLoad of form and subgrid, on refresh of subgrid it will trigger
//as well on add new record and on delete of record it will trigger
function SubgridFunctionExe(){
// here use globalFormContext
globalFormContext.data.refresh(false);
}
推荐阅读
- cassandra - Cassandra 数据建模 - 识别最佳行键
- c++ - 为什么 `std::unary_function` 仍然在 c++17 中编译?
- javascript - jquery中的id不起作用
- c++ - CurlPP 不会多次请求
- python - PyCharm 代码完成不适用于已安装的库
- python - python numpy.nanmean() 返回 Nan
- xaml - 如何在 UWP 的文本块中添加按钮?
- sensors - Mbed SPI 与数字传感器通信
- python-3.x - Python 文字冒险游戏输入无限循环
- c# - 下拉 ASPX 如何从列表中查询