How to refresh dataSource and retain position
1698 ワード
// Copyright (C), 2015, CEU Co., Ltd.
// USR Changed by 2015-01-05T16:56:10 Fandy Xie
// Version : 1.0
// Description :
// Return :
static void refreshDSRecord(Args _args)
{
/* method 01
myTable_ds.reread();
myTable_ds.refresh();
*/
/* method 02
myTable_ds.research(true);// or -1
*/
/* method 03
public static void main(Args args)
{
YIP_BOMCopy YIP_BOMCopy;
FormDataSource fds = args.record().isFormDataSource() ? args.record().dataSource() : null;
BOMTable bomTable = args.record();
BOMTable newBOMTable;
;
YIP_BOMCopy = YIP_BOMCopy::construct();
YIP_BOMCopy.parmFromBOMId(bomTable.BOMId);
if (YIP_BOMCopy.prompt())
{
YIP_BOMCopy.run();
newBOMTable = YIP_BOMCopy.parmNewBOMTable();
}
if (newBOMTable)
{
if (fds && args.dataset() == tablenum(BomTable) )
{
bomTable.data(newBOMTable);
fds.reread();
fds.refresh();
}
}
}
*/
/* method 04
#task
fds = this.isFormDataSource() ? this.dataSource() : null;
if (fds)
{
fds.formRun().task(#taskFormRefresh_F5);
}
*/
/* method 05
int position;
;
position = myTable_ds.getPosition();
myTable_ds.research();
myTable_ds.setPosition(position);
*/
/* method 06
MyTable myTableHolder;
;
myTableHolder.RecId = myTableRecord.RecId;
myTable_ds.research(); // or: myTableRecord.dataSource().research();
myTable_ds.findRecord(myTableHolder); // or: myTableRecord.dataSource.findRecord(myTableHolder);
*/
}