当我们需要根据列表选中行的分录中的字段做进一步判断处理时,我们可以使用如下语句获取列表中选中行的数据:
BillList billList = this.getView().getControl("billlistap");
ListSelectedRowCollection selectedRows = billList.getSelectedRows();
Set<Long> selectedRowsPrimaryKeyValue = new HashSet<>(8);
for (ListSelectedRow selectRow : selectedRows) {
selectedRowsPrimaryKeyValue.add((Long) selectRow.getPrimaryKeyValue());
}
QFilter filter = new QFilter("id", QCP.in, selectedRowsPrimaryKeyValue);
Map<Object, DynamicObject> billInfo = BusinessDataReader.loadFromCache("表单标识", filter.toArray());
for (DynamicObject billI : billInfo.values()) {
DynamicObjectCollection entryEntity = (DynamicObjectCollection) billI.get("entryentity");
for (DynamicObject entry:entryEntity) {
entry.getDynamicObject("行字段")
}
}
推荐阅读