AOT查询关系或大小写 [英] AOT Query relation OR case
本文介绍了AOT查询关系或大小写的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
例如,我有以下x ++查询.
For example I have the following x++ query.
Select EcoResproduct
join tableX
where EcoResproduct.RecId == tableX.Product
|| EcoResproduct.RecId == tableX.DistinctProductVariant;
是否可以通过 AOT查询做同样的事情,而无需使用联合查询或添加两次相同的数据源,也完全不需要使用QueryBuildDataSource对象和X ++.
Is that possible to do the same thing through AOT query without using a union query or adding two times the same datasource and without using QueryBuildDataSource object and X++ at all .
预先感谢
PS:我的问题更清楚了.
PS: I made my question more clear.
推荐答案
初始错误答案:
是否可以通过AOT查询执行相同的操作而无需使用联合查询或添加两倍的相同数据源
Is that possible to do the same thing through an AOT query without using a union query or adding two times the same datasource
否.
正确的答案,感谢评论者:
Query q = new Query();
QueryBuildDataSource qbds1 = q.addDataSource(tableNum(EcoResproduct));
QueryBuildDataSource qbds2 = qbds1.addDataSource(tableNum(TableX));
qbds2.addrange(fieldNum(TableX, RecId)).value(strFmt('((%2.Product == %1.RecId) || (%2.DistinctProductVariant == %1.RecId))', qbds1.name(), qbds2.name()));
info(qbds1.toString());
这篇关于AOT查询关系或大小写的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文