Sunday, February 16, 2014

AOT Query - Set range using "variables"

Hi

If you want to set variable ranges on AOT query, you can use SysQueryRangeUtil class. You can use existing methods there or create your own.

http://msdn.microsoft.com/en-us/library/cc618616(v=ax.50).aspx

For example, if I have an AOT query with PurchLine as datasource. Then I can add a Range to createdDateTime field with value:

(dayRange(-50,0))

I will only see PurchLine from the past 50 days relative to the session date.

When using SysQueryRangeUtil methods, there should be outer brackets enclosing the method itself.

That's it!
 

1 comment:

Dileep Gopalakrishnan said...

Thanks Bro... I've been messing with the ranges for so long.. i didn't know about the brackets