简体   繁体   English

在AX 2012中刷新整个表单?

[英]Refresh entire form in AX 2012?

I'm currently working with a form that has a grid at the bottom. 我目前正在使用底部有网格的表单。 Whenever I hit f5, the grid refreshes, but the rest of the form does not. 每当我点击f5时,网格都会刷新,但表单的其余部分却没有。 What can I do to make the entire form refresh it's data? 我该怎么做才能让整个表单刷新它的数据?

Thanks. 谢谢。

You may override the research method on a datasource: 您可以覆盖数据源上的research方法:

public void research(boolean _retainPosition = false)
{
    super(_retainPosition);
    other_ds.research(_retainPosition);
}

The other_ds is a datasource not joined by the current datasource. other_ds是未由当前数据源连接的数据源。

It depends on the form you are working with. 这取决于您正在使用的表单。 When you hit F5 on a record, it runs the research method on the datasource the record belongs to or its parent datasource (depends on the form's query, eg if you hit F5 on SalesLine in the SalesTable form, SalesTable_ds.research(true) will be run). 当您在记录上点击F5时,它会在记录所属的数据源或其父数据源上运行research方法(取决于表单的查询,例如,如果您在SalesTable表单中按SalesLine上的F5, SalesTable_ds.research(true)将运行)。 As I see it, if the rest of your form displays fields that belong to these datasources then these fields will be updated. 在我看来,如果表单的其余部分显示属于这些数据源的字段,那么这些字段将被更新。 If the fields do not belong to these datasource the rest of your form will not be updated (unless eg the active method has been overridden to refresh the rest of the form from the code. 如果字段不属于这些数据源,则表单的其余部分将不会更新(除非已重写active方法以从代码中刷新表单的其余部分。

What you can do to make the entire form refresh its data when F5 is hit: again, it depends on the form, so not knowing all the details it is difficult to advise something, but one of the things you can do is override the research method on your datasource and refresh the rest of the form programatically from there. 当F5被击中时,你可以做什么来使整个表格刷新它的数据:再次,它取决于形式,所以不知道所有的细节很难提出建议,但你可以做的一件事是覆盖research数据源上的方法,并从那里以编程方式刷新表单的其余部分。 It is more common to override the active method, you should normally go for it. 覆盖active方法更常见,通常应该去实现它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM