/** 用户自定义 query 查询器 */ static void xyf_query01(Args _args) { Query query; QueryRun queryRun; QueryBuildDataSource queryBuildDataSource; QueryBuildRange queryBuildRange; CustTable custTable; ; if ( hasSecurityKeyAccess(securityKeyNum(SysDevelopment),AccessType::View) ) { query = new Query(); queryBuildDataSource = query.addDataSource(TableNum(CustTable)); queryBuildRange = queryBuildDataSource.addRange(FieldNum(CustTable,AccountNum)); queryBuildRange.value("4000..5000"); queryRun = new queryRun(query); if (queryRun.prompt()) { while (queryRun.next()) { if(queryRun.changed(TableNum(CustTable))) custTable = queryRun.get(TableNum(CustTable)); info( custTable.Name); } } } } /*************************************************/ /** AOT下面的query查询器 */ static void xyf_query02(Args _args) { queryRun _queryRun = new QueryRun ("Cust"); queryBuildRange qbr; queryBuildDatasource qbds; CustTable _CustTable; ; qbds = _queryRun.query().dataSourceNo(1); qbr = sysquery::findOrCreateRange(qbds,fieldnum(CustTable,AccountNum)); qbr.value('DX');//给某个特定的字段初始化 qbr.status(1); //针对某个字段条件不能更改过滤条件 /** 2)sysquery::findOrCreateRange( _queryRun.query().dataSourceNo(1),fieldnum(CustTable,AccountNum)).status(1);//针对某个字段条件不能更改过滤条件 3)_queryRun.userUpdate(TRUE);//针对整个Query无法更改过滤条件 */ if (_queryRun.prompt())//OK 按钮 { while (_queryRun.next()) { _CustTable = _queryRun.get(tablenum(CustTable)); info(_CustTable.Name); } } else //取消按钮 { info("Cannal"); } }