Dear All,
I wanna get Journulnumber which in (GENERALJOURNALENTRY)table. my Table Record is VendInvoiceJour,
I tested another way in previous Comments.
1- one solution was in last topic:
https://community.dynamics.com/ax/f/microsoft-dynamics-ax-forum/207784/relationship-between-generaljournalaccountentry-and-ledgerjournaltrans
I made this script in Sql and it works well:
select e.JOURNALNUMBER, t.LEDGERVOUCHER from VENDINVOICEJOUR as T
inner join LEDGERJOURNALTRANS as g on T.LEDGERVOUCHER=g.VOUCHER
inner join GENERALJOURNALENTRY as e on e.SUBLEDGERVOUCHER=g.VOUCHER
where t.LEDGERVOUCHER='API-00000008'
But in Formula designer in Relation tables of LEDGERJOURNALTRANS ,there is n't GENERALJOURNALENTRY table,so i found Ledger journal table(JournalNum) instead it and used this script:
select j.JOURNALNUMBER, t.LEDGERVOUCHER from VENDINVOICEJOUR as T
inner join LEDGERJOURNALTRANS as g on T.LEDGERVOUCHER=g.VOUCHER
inner join LEDGERJOURNALTABLE as h on h.JOURNALNUM=g.JOURNALNUM
inner join LEDGERENTRYJOURNAL as i on i.JOURNALNUMBER=h.JOURNALNUM
inner join GENERALJOURNALENTRY as j on j.LEDGERENTRYJOURNAL=i.RECID
where t.LEDGERVOUCHER='API-00000008'
This above script works well also I can find this above path in formula designer, But when I run my report, it shows wrong "journalNumber" !
GIG_VendInvoiceJour_TR.'vendTrans()'.'<Relations'.LedgerJournalTrans.'>Relations'.LedgerJournalTable.'<Relations'.LedgerEntryJournal.'<Relations'.GeneralJournalEntry.JournalNumber

thanks in advance for any assistance
Best Regards,
Zahra