Forum Discussion
5 Replies
- AngelaIpIdeator I
Hi Ben,
I haven´t needed this use case yet, but it sounds definitely useful. By default Innovator dcannot search for relative dates like "now" or "yesterday".
But this project provided a patch to add this search option with help of parameters you can use inside your search:
https://community.aras.com/i/projects/advanced-search-options---relative-date-searches
I see a high change it can work in a Query Definition, cause basically Query Definition just build an AML query.
Would be happy to hear your test results!!
Angela
- Ben_PecotIdeator I
I have had a chance to test this. It does not appear to work. "String was not recognized as a valid DateTime."
It does not recognize @now as a valid value in the Where Condition Builder so I had to save it like: [Valid To] > '@now'
That translates to this on the qry_QueryItem:
<![CDATA[<condition>
<gt>
<property name="cub_valid_to" />
<constant>@now</constant>
</gt>
</condition>]]>I did a test with a valid date in the format of [Valid To] > ' 2022-06-15T14:57:17' and it worked correctly and saves it on the qry_QueryItem the same way with the date as the constant, but it requires the date to be static.
- Ben_PecotIdeator I
I used AML to inject the following code onto the qry_QueryItem:
<![CDATA[<condition>
<gt>
<property name="cub_valid_to" />
@now
</gt>
</condition>]]>It says that text is not accepted and the only valid options are property, constant, count, max, min, any, and all. None of those tags work with the dynamic dates that were provided in that fix.
- AngelaIpIdeator I
Hi Ben,
thanks for sharing your test results!
After checking the sample I am not sure if search_container.js is actually used by the QueryBuilder at all. If you set a debugger breakpoint, will it be triggered by the Query?
In worst case we have to customize some file in this folder: ...\Client\Modules\aras.innovator.QueryBuilder
If you have a subscription maybe ask Aras for this feature. It would definitely be a useful enhancement!
- Ben_PecotIdeator I
I was not able to find a more elegant dynamic solution so instead I have a method that updates the filter on the query definition and added that method to the scheduler.