CRM 2011:刷新关联的网格视图 [英] Crm 2011 : Refresh associated Grid View

查看:82
本文介绍了CRM 2011:刷新关联的网格视图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有一种方法可以刷新关联的Grid View?
我在帐户表单上有一个销售订单视图,在此表单上我有一个按钮(新订单),可以打开一个新的销售订单表单,在这个表单中,我做我的订单,
问题是:当我保存在订单表单上时,我想刷新与订单相关的视图(在帐户表单中),但我不知道如何获取控件名称或如何访问它。
我尝试了很多方法,例如

Is there a way to refresh associated Grid View ? I have a Sales Order View on the Account Form, on this Form I have a button (New Order) that open a new Sales Order Form, in this form I do my Orders, The question is : When I save on my Order Form I want to refresh my Order associated View (in the Account Form) , but I don't know how to get the control name or how to access to it. I tried many ways Like

  Xrm.Page.ui.controls.get("Orders").refresh();
  document.getElementById("areaOrders").contentWindow.location.reload(true);

谢谢。

推荐答案

要刷新子网格,可以使用

To refresh a subgrid you can use

Xrm.Page.getControl('new_subgrid').refresh();

但是,根据我的经验,它非常容易出错(无论如何,因为RU12),因此请谨慎使用。您还需要检查检索到的控件的类型,并确保它是网格或将引发错误。

However in my experience it is very buggy (since RU12 anyway), so use with caution. You also need to check the type of the control you retrieve and ensure it is a grid or an error will be thrown.

但是您问了一个稍有不同的问题:

However you have asked a slightly different question:


当我保存在订单表中时,我想刷新与订单相关的视图(在帐户表单中)

When I save on my Order Form I want to refresh my Order associated View (in the Account Form)

据我所知,这意味着您已经从帐户表单中打开了订单表单,并希望刷新帐户表单中的子网格。

Which I understand to mean you have an Order form opened from an Account form and want to refresh the subgrid on the Account form.

简单的答案是否,您不能以受支持的方式执行此操作。

The easy answer is no, you cannot do this in a supported way.

这可能是可行的,但并非如此。您需要获取打开窗口的引用,该窗口可能在

It may be possible but it wouldn't pretty. You'd need to get a reference to the opening window, which may be available in

window.opener

我没有尝试过,也不在机器前进行尝试。但是我不建议这样做,替代方法是单击以手动刷新子网格。这不是一个坏选择。

I haven't tried and am not infront of a machine to try it. But I would advise against it, the alternative is a single click to manually refresh the subgrid; it isn't a bad alternative.

这篇关于CRM 2011:刷新关联的网格视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆