/**
*
* @param number 数据值
* @param type 所属单据类型
* @return
*/
public static DynamicObject getExpenseProject(Object number,String type){
DynamicObject obj = BusinessDataServiceHelper.newDynamicObject(type);;
String key=obj.getDataEntityType().getDBRouteKey();
String sql="SELECT A.FId id,A.Fnumber number,B.fname name " +
"FROM A " +
"INNER JOIN B ON B.FId=A.FId AND B.FLocaleId='en_US' AND B.fname ='"+ number+"'";
DataSet ds= DB.queryDataSet(SubmitAuditUtil.class.getName(), DBRoute.of(key),sql,null);
if (!ds.isEmpty()){
for (Row row:ds) {
obj.set("id",row.get("id"));
obj.set("number",row.get("number"));
obj.set("name",row.get("name"));
break;
}
}
return obj;
}
推荐阅读