/*
* BusinessDataServiceHelper取多选基础资料值demo
* entityName:实体编码
* mulbasedatafield: 多选基础资料字段
* billno:单据编码
* selectFields:查询字段
*/
String entityName = "ecos_apply";
String selectFields = "billno,id,mulbasedatafield";
String billno = "Caigou#20200520-00000002";
QFilter qfilter = new QFilter("billno","=",billno);
QFilter[] qfilters ={qfilter};
Map<Object, DynamicObject> map = BusinessDataServiceHelper.loadFromCache(entityName, selectFields, qfilters);
for(java.util.Iterator<Entry<Object, DynamicObject>> ite = map.entrySet().iterator();ite.hasNext();) {
Map.Entry entry = ite.next();
DynamicObject object = (DynamicObject) entry.getValue(); //拿到表单对象
DynamicObjectCollection coll = (DynamicObjectCollection)object.get("mulbasedatafield");//拿到多选基础资料
if(coll!=null && coll.size()>0) {
for (int i = 0; i < coll.size(); i++) {
System.out.println(coll.get(i).getPkValue());
}
}
}
推荐阅读