导航

定位form光标行

Posted on 2015-06-04 14:59  Tokywu  阅读(217)  评论(0编辑  收藏  举报

In AX2009 if you call the research() method on a form passing true, the cursor position within a grid should be retained. However, this is true only if the query created by the form uses inner joins. Any outer joins, aggregations, temp tables, etc. cause the cursor to go to either the first or last record (depending upon the StartPosition property for that data source). In 2009 if you want to keep the cursor position and use joins other than inner joins you have to keep track of the cursor position. Code like the following will do this:

 

int pos;

super();

pos = SalesTable_ds.getPosition(); 
SalesTable_ds.research(); 
SalesTable_ds.setPosition(pos);