the static method SysQueryRangeUtil::lessThanUtcNow(), used in a range within a query to populate a view, does not recover the current date. Have you ever encountered similar problems? Thank you
[ITA Version] Ciao a tutti, all'interno di una query utilizzata per popolare una vista, il metodo statico SysQueryRangeUtil::lessThanUtcNow() utilizzato in un range non recupera la data corrente. Avete mai incontrato problemi simili? Grazie
Oh, I see your problem. You have used the lessThanUtcNow
as a query range value, then made view based on the query.
This will not work, because the SQL view cannot call the AX method. The range value is baked in the view at the time of the synchronize when the view is created! You can confirm this using the SQL Enterprise Manager.
Lesson: only use real constants in a range value when used in a view.
You could of cause synchronize the view before each use, that would be rude!
Instead you have include the fields ValidTimeFrom
and ValidTimeTo
in the view and do range check on these manually.