Guidewire InsuranceSuite-Developer Question Answer
A developer wrote the following query to create a list of activities sorted by activity pattern, and then returns the first activity for a failed policy bind:

This query uses the sortBy() and firstwhere() methods which are anti-patterns. Where should the developer handle the filtering and sorting to follow best practices?
Guidewire InsuranceSuite-Developer Summary
- Vendor: Guidewire
- Product: InsuranceSuite-Developer
- Update on: Feb 21, 2026
- Questions: 77

