Query Problem

Hi All,

I have a strange problem when running this code:

while select * from inventJournalTable
join * from inventTrans where inventJournalTable.JournalId == inventTrans.TransRefId{

info(strFmt("%1, %2", inventJournalTable.JournalNameId, inventTrans.Qty));

It return nothing. But the data was there in both 2 tables, I have checked.

The relationship between these 2 tables is in AOT.

If someone has experience on the relationship between InventJournalTable and InventTrans… could you please help.

Thank you very much

I check this and I think it happens because the join fields have different lentghs. You can replace the code with something like that. This will work slower, but is better than nothing:

while select inventJournalTable
index hint journalIdx
while select inventTrans where inventTrans.TransRefId == inventJournalTable.JournalId
info(strFmt("%1, %2", inventJournalTable.JournalNameId, inventTrans.Qty));

Hi Cripan,

You may be right about the lenght of data column. This is the first time I meet this problem in Ax.

For sure, the second option that you recommended will work. It just takes time for browsing data.

Thank you

Ciprian, you’re absolutely right.
I found such problem before, and I think this is such think on which single programmer can look and does not see a solution or error.

I haven’t found some better solution then your