我正在通过ajax调用从Quote Line表单调用Web API。
API正在更新报价行实体中的Tax字段。当我获得成功响应表单API时,我需要刷新以使用此更新来从前端获取更新的税收数据。
Xrm.Page.data.refresh(true).then(successCallBack,errorCallback);
但是,此更新的税额未反映在Quote实体的相关子网格中。如果我刷新浏览器,那么我会得到,但我不想要。
该怎么做?
谢谢。
答案 0 :(得分:0)
您不仅需要刷新记录(行),还需要刷新子网格(行)。
您需要在SuccessCallBackfunction中使用以下代码段。
我已经显示了Contact子网格,但是您可以使用网格名称进行更新。
function doSomething(executionContext) {
var formContext = executionContext.getFormContext(); // get the form Context
var gridContext = formContext.getControl("Contacts"); // get the grid context Name of gird which you wish to have context of
// Perform operations on the subgrid
gridContext.refresh();
}