I have filterd by grid enabled on all forms. Now I want to filter on Date-Time fields. How can I filter all records by getting following results:
* All records where modify date between yesterday and now
* All records where modify date within the current month / year
* All records where modify date is today - 5 days untill now
* All records where modify date is previous week
...
Is this possible? Can I use e.g. "Today()-5 .. Today()" in a filter?
Regards,
Luk
*This post is locked for comments
Hi Ragnar,
Like Martin said, you can extend SysQueryRangeUtil with your own method. And these methods can take parameters. However, I don't think you can specify a "tablerecord" as a parameter...more likely you'll be passing in the unique key field(s) to your method to find the records. Then build a query range from that.
Cheers.
Hi,
Can methods in SysQueryRangeUtil take parameters, like tablerecord. I whould like to compare two fields in record.
Wbr,
Ragnar Páll
You can use methods from SysQueryRangeUtil class for such scenarios (and add new methods if something can't be done with the existing ones).
Example: (dayRange(-5, 0))
Don't forget the outer parentheses, they're important there.
Hi Luk,
Please refer to this page:
technet.microsoft.com/.../aa569937.aspx
At the bottom of the table it mentions that "Type a SysQueryRangeUtil method with parameters that specify the value or range of values." with an example.
You can then refer to the SysQueryRangeUtil class in AX. The "greaterThanDate" and "dayRange" methods seems to fit your needs, but there are other methods there that may fit better.
Cheers.
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,240 Super User 2024 Season 2
Martin Dráb 230,149 Most Valuable Professional
nmaenpaa 101,156