Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/kotlin/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在Axapta中创建查询?_Axapta_Dynamics Ax 2009 - Fatal编程技术网

如何在Axapta中创建查询?

如何在Axapta中创建查询?,axapta,dynamics-ax-2009,Axapta,Dynamics Ax 2009,这与我前面的一个问题有关。我有一个(并非如此)“复杂”的查询,有3个联接表。以下是查询: select somefield from WMSTRANSPORT INNER join GMSWmslocationwrkctr On WMSTRANSPORT.TOLOCATION = GMSWMSLOCATIONWRKCTR.WMSLOCATIONID inner join WMSLOCATIONSUM on WMSTRANSPORT.TOLOCATION = WMSLOCATIONSUM

这与我前面的一个问题有关。我有一个(并非如此)“复杂”的查询,有3个联接表。以下是查询:

    select  somefield
from WMSTRANSPORT INNER join GMSWmslocationwrkctr On WMSTRANSPORT.TOLOCATION = GMSWMSLOCATIONWRKCTR.WMSLOCATIONID
inner join WMSLOCATIONSUM on WMSTRANSPORT.TOLOCATION = WMSLOCATIONSUM.WMSLOCATIONID
where 
EXPEDITIONSTATUS=3 OR EXPEDITIONSTATUS =4

如何将“转换”为X++代码?

只需将ON子句更改为WHERE子句,使用==代替=,使用| |代替OR:

select somefield
from WMSTRANSPORT 
where (WMSTRANSPORT.EXPEDITIONSTATUS==3 || WMSTRANSPORT.EXPEDITIONSTATUS==4)
join GMSWmslocationwrkctr where WMSTRANSPORT.TOLOCATION == GMSWMSLOCATIONWRKCTR.WMSLOCATIONID
join WMSLOCATIONSUM where WMSTRANSPORT.TOLOCATION == WMSLOCATIONSUM.WMSLOCATIONID

非常感谢。另一个问题:如何将此查询绑定到网格?可能吗?不可能。您必须构建一个查询对象并将其传递给表单的数据源。本文介绍如何在AOT查询对象上使用多个连接的数据源: