selectHandler (handlers/select-related) and getSelectFilters let a link field scope the select modal's results dynamically based on the host record's current values. This works correctly for the query. However, any filter returned via the advanced key is rendered in the select modal as a visible, user-editable/removable filter pill.
When the filter targets a relationship rather than a real field on the foreign entity (e.g. filtering Account by its contactsrelation), the pill renders as an empty/broken control, and — more importantly — the user can remove it, defeating the intended scoping.
There is currently no supported return key to apply an advanced filter as a hidden constraint (applied to the query, not surfaced in the filter UI).
Concrete example
A common requirement: on Opportunity, when a primary contact is selected, the account field's select modal should only offer accounts linked to that contact.
clientDefs/Opportunity.json:
Handler:
This filters the Account list correctly (only accounts linked to the selected contact appear), but because contacts is a relationship and not a field on Account, the resulting advanced-filter pill renders empty and is user-removable.
So today a developer must choose between a filter that carries the dynamic value but renders a removable/broken pill, or a hidden filter that can't see the dynamic value.
Benefit
Cascading link-field scoping based on a related record's relationships is a frequent customization need. A hidden-filter channel would make it a first-class, non-hacky pattern rather than requiring a custom field view + custom select-records modal override.
When the filter targets a relationship rather than a real field on the foreign entity (e.g. filtering Account by its contactsrelation), the pill renders as an empty/broken control, and — more importantly — the user can remove it, defeating the intended scoping.
There is currently no supported return key to apply an advanced filter as a hidden constraint (applied to the query, not surfaced in the filter UI).
Concrete example
A common requirement: on Opportunity, when a primary contact is selected, the account field's select modal should only offer accounts linked to that contact.
clientDefs/Opportunity.json:
PHP Code:
{
"fields": {
"account": {
"selectHandler": "custom:handlers/opportunity/contact-account"
}
}
}
Handler:
PHP Code:
define('custom:handlers/opportunity/contact-account', ['handlers/select-related'], (SelectRelatedHandler) => {
class ContactAccountSelectRelatedHandler extends SelectRelatedHandler {
getFilters(model) {
const advanced = {};
const contactId = model.get('contactId');
if (contactId) {
advanced.contacts = {
type: 'linkedWith',
attribute: 'contacts',
value: [contactId],
};
}
return Promise.resolve({advanced});
}
}
return ContactAccountSelectRelatedHandler;
});
This filters the Account list correctly (only accounts linked to the selected contact appear), but because contacts is a relationship and not a field on Account, the resulting advanced-filter pill renders empty and is user-removable.
So today a developer must choose between a filter that carries the dynamic value but renders a removable/broken pill, or a hidden filter that can't see the dynamic value.
Benefit
Cascading link-field scoping based on a related record's relationships is a frequent customization need. A hidden-filter channel would make it a first-class, non-hacky pattern rather than requiring a custom field view + custom select-records modal override.

Comment