while select * from salesline join inventtransorigin where salesline.InventTransId == inventtransorigin.InventTransId
join inventtrans where inventtransorigin.RecId == nventtrans.InventTransOrigin
join subledgerVoucherGeneralJournalEntry where inventtrans.Voucher == subledgerVoucherGeneralJournalEntry.Voucher
join generalJournalAccountEntry where subledgerVoucherGeneralJournalEntry.GeneralJournalEntry == generalJournalAccountEntry.GeneralJournalEntry
join dimensionAttributeValueCombination where generalJournalAccountEntry.LedgerDimension == dimensionAttributeValueCombination.RecId
join mainAccount1 where dimensionAttributeValueCombination.MainAccount == mainAccount1.RecId
join mainAccountCategory where mainAccount1.AccountCategoryRef == mainAccountCategory.AccountCategoryRef
join ledger where mainAccount1.LedgerChartOfAccounts == ledger.ChartOfAccounts
join companyinfo where ledger.PrimaryForLegalEntity == companyinfo.RecId
&& mainAccount1.RecId == mainAccount.RecId
&& companyinfo.DataArea == curext()
Here that relation wich is highlited is not proper for me, the Voucher is same for multiple Item.. so is their any other way to do this