Siirry sisältöön
Menu
Sinun on rekisteröidyttävä, jotta voit olla vuorovaikutuksessa yhteisön kanssa.
Tämä kysymys on merkitty
1 Vastaa
4454 Näkymät

I need to filter employees and other custom data by company. Is there a way to create a wizard to select the company and globally filter only the data that is connected to that company by its ID?

I'm new to search views and filtering so I'd like some suggestions for the best approach to filter data by company_id.

Thanks!  

Edit:

How can I use and get the id from the selected company and use it in filters? Selected company shown in picture with red square.


Avatar
Hylkää

Try Record rules.

Tekijä

nope... can't use them. a user can have more than one company, so I need a way that he can select on what company he wants to work and then filter by that company. But the more I'm looking I doubt that there is a way. Maybe with domain and context, but haven't figured out how to use them.

Tekijä

Kevin you were right... I didn't use access rules before so I didn't know how they work. If you write an answer I'll mark it. But do you maybe know how to make those rules apply for administrator as well? So I don't need switch users every time I upgrade an app and then want to test the rule.

Paras vastaus

Try to create a field in some model with the value of the filter you want and then in the record rules you put the domain for that model, For example: ['id','=',Field_record']

Avatar
Hylkää
Aiheeseen liittyviä artikkeleita Vastaukset Näkymät Toimenpide
2
huhtik. 24
5219
1
huhtik. 20
3972
3
tammik. 24
17201
6
elok. 18
11231
1
toukok. 17
3436