您的位置:首页 > 其它

Dynamics NAVAX Refresh caller form[AX 2012]

2015-08-20 10:23 477 查看
Refresh caller form [AX 2012]

There are a few ways to refresh a caller form. You may notice in AX2012 sometimes calling research(true) causes the record to jump to the starting position.

The right way is to reread the references data sources before calling the research(true). Below is some sample code I use.

 

Code:
/// <summary>
/// Refresh the caller form by calling the research(true) which does not work.
/// research(True) alone will jump the cursor to the begining (either first or last) record.
/// </summary>
/// <remarks>
/// Taken from form InventTableInventoryDimensionGroups.closeOk()
/// </remarks>
public void refreshCaller()
{
Common          common;
FormDataSource  callingFormDataSource;

common = element.args().record();
if (common)
{
callingFormDataSource = common.dataSource();
if (callingFormDataSource)
{
// Referenced datasources must be reread before calling research as data has been modified behind the scenes
// without calling research will fail to position selection correctly
callingFormDataSource.reread();
callingFormDataSource.rereadReferenceDataSources();
callingFormDataSource.research(true);
}
}
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  Dynamics NAVAX Refre