How to refresh list page and do not lost focus in grid?





I opened detail form in list page grid. I have done some changes in the detail form(say added the qty, changed the unit price..etc), while close() the form I am refreshing the list page grid (only the selected record. it increase the performance rather refresh all records in the grid)


   FormDataSource   callerDataSource;
   int                          position;

  if (element.args().record())
  {
       callerDataSource = element.args().record().dataSource();  
       position               = callerDataSource.getPosition();
       callerDataSource.reread();        
       callerDataSource.refreshEx(position); //To refresh the specific record in the list page


      //if you want to refresh all records in the list page,(comment refreshEx() call above)
       /*callerDataSource.research(true);
       callerDataSource.setPosition(position); */
  }


Thanks,
Vijaykarthik



Comments

Popular posts from this blog

x++ code to Generate cheque for vendor payment journal

Import Procurement Hierarchy / Categories with out code in ax 2012

Copy favorites From one user to another user - Ax 2012