Creating a query using only X++

Hello,

Can somebody please provide me a simple X++ code that I can run in the AOT and create a query that I can then link to a form or report? I know there is a gui query builder in the AOT, but it has its limitations and thus I need to write X++ queries for my intermediate and advanced reports, but none of the code I have found on the net and run in the JOBS Editor has actually created a query object in the AOT that can use as a data source. If I need to do any additional steps besides running the code please let me know as well.

Thanks,

Tee

Just curious… What features are supported by AOT queries but are not exposed as properties in AOT, so you can set them in code only? I can’t remember any. There are tricks that are not supported by AOT queries, but trying to create the query by code wouldn’t make any difference.

Find out there http://msdn.microsoft.com/en-us/library/aa867829.aspx