In the lookup table filter is there any way to set a filter A when showing data in list/edit/view/add page and a filter B when opening the lookup modal?
For example I have a CustomerID which points to customers table.
When opening the modal I want to filter the selectable customers list on a specific AreaID (which can change sometimes).
But managing old records I want to clear the filter, because of mantaining historical variations. If I use the previous filter, the lookup table is empty.
How to do it?
I'd prefer to CHANGE the filter string, not clear it, for complex scenarios.
Thanx.
A
Change the lookup table filter
-
- User
- Posts: 111
Change the lookup table filter
-
- User
- Posts: 150
Hi there,
I think you need to have a different approach, change the query for the lookup to include the historical values.
E.g. let's assume a scenario like yours:
- You have a table of Customers, where some of them are active and some old entries are inactive.
- The lookup table should contain all active records.
Then, in Lookup_Selecting event, change the UserSelect property by appending an union with the entry in your record:
if (fld.Name == "CustomerIDField") {
UserSelect += " UNION select CustomerID, CustomerName where CustomerID = " + Convert.ToString(CustomerIDField.CurrentValue);
}