
Hi everyone,
I am developing a custom SSRS report for Return Orders. I have encountered an issue where the report displays duplicate lines for the same item, even though the 'All return orders' form shows only a single line.
After investigating via Table Browser, I found that the SalesLine table contains two records for the same SalesId and ItemId:
One record with SalesStatus::Invoiced
One record with SalesStatus::OpenOrder
Both records appear to be related to the same transaction.
Current Logic:
In my class, I am using MultiSelectionHelper to get the selected SalesTable and then fetching lines using a simple 'while select' based on SalesId.
Question:
What is the best practice to filter out these 'duplicate' records to ensure the report matches the UI? Is there a standard method like salesLine.isReturnLine() or a specific field I should use to identify the "primary" line?
Any suggestions would be greatly appreciated.