How to write dynamics query in X++ ?

Hi All,

Am getting report from parameters

1.fromdate

2.todate

  1. BusinessUnit(multiselect lookup)

  2. Bankaccount(multiselect lookup)

Based on above parametes i want to generate report from general journals , so how to write dynamic query , business unit coming from dimensionattributebaluecombination table, same bankaccount also comes from dimensionattributebaluecombination table in generaljournal’s , so how to write dynamic query. please help me

Thanks,

Krishna.

Can you please explain why you want to write a “dynamic” query (and maybe what you mean by "dynamic) and what problem you have with it?

Are you trying to build a query-based report or an RDP-based report?

I would use an RDP class, but I would still consider designing the query in AOT. Then you must decide whether you let users to simply set report ranges or you’ll build a separate data contract and UI builder (which I would avoid if not necessary).