AbstractRuns after the user picks a row and before the value is written. Return false to cancel the pick — used where choosing a record has a side effect the user should confirm first.
Values to prefill when the user creates a new related record from the dropdown's footer.
AbstractLookupThe rows for the current query and scope, in the order they should render. Called for the empty query too — that is the browse list the user sees on focus.
Return no rows only when nothing matched. When the query itself failed, throw (an FKLookupFailedError reads best): the field then shows an error with Retry instead of "No matches", which would tell the user the record does not exist.
WHERE fragment the field applies when it hydrates the user's recent picks, so a record this strategy's population no longer includes stops being offered under "Recent". Empty means no filter beyond the primary-key list.
Labels for the scope toggle, or null to hide it. Called before every Lookup so a strategy can decide per field whether a second population is worth offering.
Base class for a foreign-key lookup strategy. Subclass, implement Lookup, and register it with
@RegisterClass(FKLookupStrategy, '<key>')— see the module doc for the key forms.Marked
@OptionalKeyedSpecializationbecause a keyed lookup landing on the base is the designed outcome for nearly every foreign key in the system, not a failed resolution.