HowToFilterReference - EtheaDev/kitto2 GitHub Wiki
How to filter data in a reference
filter in dependence of the value of a field of the same model
The feature is implemented by the FilterBy node as in the following example from a real project (The user first selects the Customer and then the invoice):
ModelName: Payment
Fields:
....
Customer: Reference(Customer) not null
PhysicalName: FK_PAGAMENTO_CUSTOMER
Fields:
Customer_Id:
PhysicalName: CUSTOMER_ID
Invoice: Reference(Invoice) not null
Fields:
Fattura_Id:
PhysicalName: INVOICE_ID
FilterBy:
Customer: Customer
filter in dependence of other values
The feature is implemented by the LookupFilter node as in the following example from a real project (activities are filtered in accordance to current user):
ModelName: Activity
Fields:
Employee: Reference(Employee) not null
PhysicalName: FK_ACTIVITY_EMPLOYEE
DisplayWidth: 10
LookupFilter: (EMPLOYEE_ID = '%Auth:EMPLOYEE_ID%')
Fields:
Employee_Id:
```yaml