Quantcast
Channel: Microsoft Dynamics AX Forum - Recent Threads
Viewing all articles
Browse latest Browse all 72043

AOT Query - Complex `WHERE` clause

$
0
0

I'm creating an AOT query which will be used in a view. 

I need to add the following SQL `WHERE` clause to the query (the MarkupTrans and ExchangeRate tables are part of the query's data sources)

		MarkupTrans.TRANSDATE	<= ExchangeRate.ValidTo 
	AND MarkupTrans.TRANSDATE	>= ExchangeRate.ValidFrom 

I tried to override the `init()` method with the following code, but it does nothing to filter the view results.

public void init()
{
    super();
	Query.dataSourceName("MUTrans")
		.addRange(fieldNum(MarkupTrans, TransDate))
			.value(strFmt(
				"(((%1.%2) <= (%3.%4)) && ((%1.%2) >= (%3.%5)))" 
				, Query.dataSourceName("MUTrans").name() 
				, fieldStr(MarkupTrans, TransDate) 
				, Query.dataSourceName("CurrXR").name() 
				, fieldstr(A147_CurrXR_View, ToDate)  
				, fieldstr(A147_CurrXR_View, FromDate)));
}

The above is not being reflected in the view...

Any idea how to add the where clause ?


Viewing all articles
Browse latest Browse all 72043

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>