Hi all,
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
What you have in AOT is just a definition of a database view. When you run database synchronization, your definition is used to create the actual database view. That’s also the time when your X++ method is evaluated. You can verify it by looking at the view definition through SQL Server Management Studio. I assume that’s what you mean when saying that it “does not recover the current date”.
You can’t expect SQL Server to call X++ methods from views.
Instead of trying to add filtering to the view definition, simple add a range when selecting data from the view.
This is range that i have used in a query

i create a scheduled job that force synchronize only for this view
That’s nice, but have you read my reply? Either you expect that it use the current time when running the view and then my reply explains what it can’t work. Or you have a different problem and you’ll have to tell us what is it. The picture doesn’t add any new information.