Problem Summary
I'm trying to implement dynamic filtering for a Wallet field in TopUp entity based on the selected Account. When a user selects an Account, the Wallet field should only show wallets that belong to that account. Current Setup
API request should include whereAdditional parameter: http://localhost:8080/api/v1/Wallet?...ereAdditional=[{"type":"equals","attribute":"accountId","value ":" 659620fee3422dd94"}] Files to Share
Questions
I'm trying to implement dynamic filtering for a Wallet field in TopUp entity based on the selected Account. When a user selects an Account, the Wallet field should only show wallets that belong to that account. Current Setup
- EspoCRM Version: 8.4 (Docker)
- Entity: TopUp with fields accountId (link to Account) and walletId (link to Wallet)
- Relationship: Wallet belongs to Account via accountId field
- Implementation: Dynamic Handler in top-up-dynamic-handler.js
- Dynamic Handler with selectFilterData:
Code:
walletView.selectFilterData = { whereAdditional: [{ type: 'equals', attribute: 'accountId', value: accountId }] };
- Override actionSelect method:
Code:
walletView.actionSelect = function() { var options = { scope: 'Wallet', multiple: false, whereAdditional: [{ type: 'equals', attribute: 'accountId', value: accountId }] }; // Create modal with options... };
- Global AJAX hooks (jQuery, Fetch, XHR) to modify API requests
- Dynamic handler loads successfully ✅
- Account change detection works ✅
- Wallet field found ✅
- Filter applied in modal options ✅
- BUT: API request still shows unfiltered URL: http://localhost:8080/api/v1/Wallet?...2CbalanceAmoun t%2Cname%2Cname&maxSize=10&offset=0&orderBy=&order =
API request should include whereAdditional parameter: http://localhost:8080/api/v1/Wallet?...ereAdditional=[{"type":"equals","attribute":"accountId","value ":" 659620fee3422dd94"}] Files to Share
Questions
- What's the correct way to apply whereAdditional filters to link field selections in EspoCRM 8.4?
- Why doesn't the modal's whereAdditional option translate to API request parameters?
- Is there a better approach than overriding actionSelect for this use case?
- The handler successfully detects account changes
- Modal creation works with correct options
- All console logs show expected values
- Only the final API request lacks the filter parameter
Comment