A query can also be built dynamically using X++ code. This can be the only way of
creating the query, if you would like the query to work in one way in some cases and
in another way in other cases. An example can be where you would like to join one
table if one condition is true and another table if the condition is false. To do this,
you need to understand how the query object model works.