Joining two datasources on MorphX report

Hi AX world,

I created a MorphX report in AX2012 which I need two dataSources. The parent DS is ProjInvoiceJour and it has a child DS, ProjInvoiceItem. I set the child relations to field that will link the two table. But the problem, when I ran the report the ProjInvoiceItem is empty. The datasources node looks like this:

8637.proj.PNG

I tried to put below lines of codes in the fetch method, and the ProjInvoiceItem holds the correct record. (The field in where clause is the same fields I have in relations)

select projInvoiceItem

where projInvoiceItem.ProjInvoiceId == ProjInvoiceJour.ProjInvoiceId

&& projInvoiceItem.InvoiceDate == ProjInvoiceJour.InvoiceDate;

I believe that I dont need to have the above codes in the fetch method, cause the query in DS will perform it. But it is really weird why I still need to initialize the projInvoiceItem.

Any thoughts will be a big help. Thanks!

Have you properly specifed the relation in the report query?

Yes, I set the relation properly and the type of join is innerjoin. Do I need to do some codes regarding querybuilddatasource ?

It seems that the relation will not work since the parent DS will have its value at runtime. I stick with my solution of using the select query to set the child DS records.

Thanks anyway!