Advanced Search Options - Relative Date searches
This patch makes it possible to use specific parameters in Aras searches that are computed at runtime. For example, there is a parameter @userid
which is replaced by the userid of the currently logged-in user each time the search is executed.
This is extremely handy for saved searches, which are shared amongst others: If a search like <created_by_id>@userid</created_by_id>
is shared and shown on the TOC, only one SavedSearch item exists in the database, but every user has an individual "Created by me" search available.
Of course, you can use multiple parameters in one query, so event statements like "Between yesterday and tomorrow" are possible:<modified_on condition="between">@today(-1) and @today()</modified_on>
Relative date searches make it possible to have saved searches like
1. New This Week
<created_on condition='ge'>@bow</created_on>
// @bow
aka beginning of week expands to last Monday, 00:00am
2. Due This Month
<due_date condition='le'>@eom</due_date>
// @eom
aka end of month expands to first day of next month, 00:00am
3. Locked by myself
<locked_by_id>@userid</locked_by_id>
Bookmarking the searches allows for quick access to these parameterized queries:
While these parameters work independently of the search mode (Simple, Advanced, AML), most of the time you will use them in AML mode, simply because the user interface does not allow you to enter freetext for date properties, but will show a calendar widget instead.
Interested in this project? Check it out on GitHub!
https://github.com/rneuber1/ArasAdvancedSearches
Contributors
Rolf Neubersch