Is there a way of joining the LedgerJournalTrans to the GeneralJournalEntry/GeneralJournalAccountEntry on a 1 to 1 level? Joining through Voucher appears to be a 1 to many relation.
*This post is locked for comments
Is there a way of joining the LedgerJournalTrans to the GeneralJournalEntry/GeneralJournalAccountEntry on a 1 to 1 level? Joining through Voucher appears to be a 1 to many relation.
*This post is locked for comments
Hi,
Please let me know if you have a solution.
Thanks,
karthik.
I am trying to join the LedgerJournalTrans to the GeneralJournalAccountEntry on a 1 to 1 relationship for a display method.
I am using LedgerJournalTrans "Txt" field as a way to use description.
Take a look at this job, I hope it helps you to understant the relations between the tables:
static void tutorialAccesLedgerJournalTransVoucher(Args _args) { Ledger ledger = ledger::findByLegalEntity(CompanyInfo::find().RecId); LedgerJournalTrans ledgerJournalTrans; GeneralJournalEntry generalJournalEntry; GeneralJournalAccountEntry generalJournalAccountEntry; DimensionAttributeLevelValueAllView dimensionAttributeLevelValueAllView; DimensionAttribute dimensionAttribute; while select ledgerJournalTrans join generalJournalEntry index hint LedgerAccountingDateIdx where generalJournalEntry.Ledger == ledger.RecId && generalJournalEntry.AccountingDate == ledgerJournalTrans.TransDate && generalJournalEntry.SubledgerVoucher == ledgerJournalTrans.Voucher join generalJournalAccountEntry where generalJournalAccountEntry.GeneralJournalEntry == generalJournalEntry.RecId { info(strFmt("%1", generalJournalAccountEntry.AccountingCurrencyAmount)); //financial dimensions related to the voucher line while select dimensionAttributeLevelValueAllView where dimensionAttributeLevelValueAllView.ValueCombinationRecId == generalJournalAccountEntry.LedgerDimension join dimensionAttribute where dimensionAttribute.RecId == dimensionAttributeLevelValueAllView.DimensionAttribute { info(strFmt("%1 %2", dimensionAttribute.localizedName(), dimensionAttributeLevelValueAllView.DisplayValue)); } } }
GeneralJournalEntry tables links to SubledgerGeneralJournalEntry table by the "GeneralJournalEntry" field in SubledgerGeneralJournalEntry table.
and yes it has 1 to many relationship based on voucher, dataareaid and trans date. this is valid.
can you explain what is your exact requirement is ? and what you are looking to achieve ?
André Arnaud de Cal... 291,820 Super User 2024 Season 2
Martin Dráb 230,514 Most Valuable Professional
nmaenpaa 101,156