eas之列表界面写脚本时如何写sql
var easNames = JavaImporter();
easNames.importPackage(Packages.com.kingdee.bos.dao.query);
with(easNames){
var tblMain=pluginCtx.getKDTable("tblMain");
var selectRows=com.kingdee.bos.ctrl.kdf.table.util.KDTableUtil.getSelectedRows(tblMain);
for( var i=0; i<selectRows.length; i++) {
var id= tblMain.getCell(selectRows[i],"id").getValue();
// com.kingdee.eas.util.client.MsgBox.showInfo(id);
var sqlcha=" select CFKDTEXTFIELD from T_AR_OtherBill where fid ='"+id+"' ";
var aaaa=SQLExecutorFactory.getRemoteInstance(sqlcha).executeSQL( );
var CFKDTEXTFIELD="";
var projectValue="";
if(aaaa.next()){
CFKDTEXTFIELD=aaaa.getString("CFKDTEXTFIELD");
// com.kingdee.eas.util.client.MsgBox.showInfo( CFKDTEXTFIELD);
projectValue=new javax.swing.JOptionPane.showInputDialog( null ,"请输入发票号:", CFKDTEXTFIELD);
}else{
projectValue = new javax.swing.JOptionPane.showInputDialog(null,"请输入发票号:","必康",javax.swing.JOptionPane.PLAIN_MESSAGE);
}
var sql=" update T_AR_OtherBill set CFKDTEXTFIELD='"+projectValue+"' where fid ='"+id+"' ";
com.kingdee.eas.csinterface.syncdatabase.SQLFacadeFactory.getRemoteInstance().exeSQL(sql);
}
pluginCtx.getKDTable("tblMain").refresh();
}