Add filter to reference depending on another reference
See original GitHub issueHi.
i have 2 reference fields, for example, permissions and users, and i want to filter users filed depending on permissions choice, something like:
myEntity.creationView()
.fields([
nga.field('permission_id', 'reference')
.targetEntity(permissions)
.targetField(nga.field('name')),
nga.field('user_id', 'reference')
.targetEntity(users)
.remoteComplete(true)
.targetField(nga.field('name'))
.permanentFilters({ 'permission_id': entry.values.permission_id })
.template('<ma-reference-field ng-if="entry.values.permission_id" field="::field" value="value" datastore="::datastore"></ma-reference-field>')
]);
Is it possible?
Issue Analytics
- State:
- Created 8 years ago
- Comments:17 (2 by maintainers)
Top Results From Across the Web
Filter reference field based on another reference - ServiceNow
Solved: Hi, I am modifying existing catalog item "Create item" to include some of the custom fields we added in Case. I have...
Read more >How to filter references based on change in another reference?
Based on your schema, I think this should work: export default { title: "Product Category", name: "category", type: "object", ...
Read more >Filter by using advanced criteria - Microsoft Support
If the Excel data you want to filter requires complex criteria you can filter by using ... All other references in the formula...
Read more >Use Reference Filters with Conditions - Skuid Docs
A useful tool for admins, a reference filter points to a reference field—a field in the model's data object that references a field...
Read more >Field filter reference another field filter in Dashboard - Get Help
You would have to create a lookup table, so both questions would use that for aliasing. It's will quickly get rather complex. Alternatively, ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I just made it work perfectly combining the codes from various topics:
and adding “scope.refresh(‘’);” to this piece of code:
if (!!field._getPermanentFilters) { scope.$watch('entry.values', function(newValue, oldValue){ field._getPermanentFilters(newValue); scope.refresh(''); }, true); }
This is indeed an extra useful feature!! 😃+1 for this feature. maybe we shouldn’t reuse the name “permanentFilters”, maybe a new call