各个模块的刷新js

时间:2022-10-31 17:30:57
 // 更新页面中的subgrid
function refreshSubGrid(subgridName) {
Xrm.Page.ui.controls.get(subgridName).refresh();
//Xrm.Page.getControl(subgridName).refresh()
} // 刷新页面中的iframe
function refreshIframe(iframeName) {
setTimeout(function () {
window.parent.document.getElementById(iframeName).contentWindow.location.reload();
}, 200); //0.2秒后重新加载当前页面
} // 刷新整个窗体
function refreshForm() {
var entityId = Xrm.Page.data.entity.getId();
var entityName = Xrm.Page.data.entity.getEntityName();
if (entityId && entityName) {
setTimeout(function () {
Xrm.Utility.openEntityForm(entityName, entityId);
}, 1000); //1秒后重新加载当前页面
}
}