Show answerHide answer
Correct answer: C Create a function using a Gosu query and a subselect clause, then call that function from the filter property.
Explanation
Answer Option (Which option is correct) C. Create a function using a Gosu query and a subselect clause, then call that function from the filter property.Explanation:
Apply query predicates and sorting in the database before selecting or materializing results. Query-backed list filters should refine the query rather than hide already-loaded rows or filter a large collection in application memory. This reduces unnecessary data transfer and entity loading.
Verification note: The exact option selection could not be independently verified from accessible official documentation. Relevant official topic links are provided, but some exact configuration or training rules require the product Configuration Guide or Cloud Standards behind sign-in. The source key is retained.
Why the other options are incorrect:
A. Use a Gosu query with a "where" clause to find the needed rows, then pass the results to the filter:
A collection where filter can run after selection. That may load rows which will later be discarded. The complex filter should refine the query itself.
B. Use a "for" loop with an "if" statement to find the needed rows, then pass the results to the filter:
A for loop and if check filter loaded records. They do not restrict the SQL result. The database should perform the qualifying selection.
D. Create a function using a Gosu query and compare clauses, then call that function from the filter property:
compare clauses can express many valid filters. The source has not described the complex predicate in enough detail. Excluding this alternative requires the missing query requirements.
References:
Guidewire - Query-backed collections and buildBaseQuery