在 Dynamics 365 CRM 统一接口中重新加载/刷新子网格时重新加载表单的问题 [英] Problem with Reload Form on reload/refresh of subgrid in Dynamics 365 CRM Unified Interface
问题描述
我有与此线程完全相同的场景:重新加载/刷新时重新加载表单Dynamics 365 CRM 统一界面中的子网格
I have the exact same scenario as this thread: Reload Form on reload/refresh of subgrid in Dynamics 365 CRM Unified Interface
不幸的是,建议的解决方案对我不起作用.方法subgridEventListener"被调用的唯一时间是在表单加载时.如果我从子网格中添加或删除记录,则不会发生任何事情.
The suggested solution does not work for me unfortunately. The only time the method "subgridEventListener" gets called is when the form loads. If I add or delete records from the subgrid nothing happens..
有没有人有可能解决这个问题的方法?
Does anyone have a possible solution to this problem?
统一接口.2019 发布第 2 波启用服务器版本:9.1.0000.16843 客户端版本:1.4.583-2004.2 –
Unified Interface. 2019 release wave 2 enabled Server version: 9.1.0000.16843 Client version: 1.4.583-2004.2 –
推荐答案
//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);
}
这篇关于在 Dynamics 365 CRM 统一接口中重新加载/刷新子网格时重新加载表单的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!