Crm 2011 : Refresh associated Grid View

后端 未结 3 1707
轻奢々
轻奢々 2021-01-24 05:04

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 th

3条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-01-24 05:36

    To refresh a subgrid you can use

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

    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.

提交回复
热议问题