Posts

Showing posts from May, 2024

Joining 1:N related table in form without row duplication using Computed fields in views

Image
Case A customer wanted to display and filter Customer reference and Customer requisition fields from sales order on Project invoice journal screen. As there is no direct link to do this and the indirect link is a 1:N or even N:N in certain cases this gets problematic when displaying the journals. Resulting in duplicate journal entries in the journal overview. As the customer only have one sales order pr. project invoice  and we are selecting the first only (Top 1) this will not be an issue. As joining and display methods do not provide filter and sort options we need to generate the data on the server using computed fields. Explanation As display methods do not provide filter and sort options and joining 1:N table relations will duplicate the journals in the list, we need to generate the data on server using computed fields. To do this we need a View with Proposal ID, join the view to the ProjInvoiceJour table on Proposal ID and add the view as a datasource to the form ProjProposalJour