Question 550
An AL extension team encounters the following situation: A query should accept a user-supplied posting-date range without exposing the field in every returned row. Which technical principle best explains the relevant risk or failure?
Explanation
Correct Answer
Query filtering can restrict records independently of displayed output columns. The corresponding corrective design is to declare a filter element or supported query filter and apply SetRange or SetFilter as appropriate. A passing check is: Different date inputs change the row set while column output remains stable.
Incorrect Answers
This option serves the scenario “A developer tries to use a standard record FindSet loop for a grouped analytical report that spans several linked tables”. SQL-backed query datasets can reduce application-side row-by-row assembly. The present scenario is distinguished by “Query filtering can restrict records independently of displayed output columns”.
This alternative addresses the separate case “A developer joins Sales Header and Sales Line but gets multiplication of line totals when the relationship is incomplete”. A partial join can duplicate records and inflate business totals. The deciding requirement here is “Query filtering can restrict records independently of displayed output columns”.
The related but distinct situation is “A grouped sales report applies a filter to the computed Sum column but expects the same behavior as filtering base rows”. Aggregate filters can act like HAVING while base-field filters act like WHERE. For the stated problem, “Query filtering can restrict records independently of displayed output columns” addresses the central condition.