问题
I have created a new table QueryCodes
and used the new surrogate key functionality in 2012.
A Foreign key relationship has been added to SalesTable
using a RefRecId
as per the new RecID
foreign key guidelines. This all works great and I can now select a QueryCode
on the SalesTable by a descriptive field rather than a drop down full of RecId
s.
However - Filtering! In any grid showing all sales orders (SalesTable
) I cannot filter for "Blank" query codes, ie SalesTable
records without a query code attached. I can filter the sales table perfectly using the descriptive field from QueryCodes (for the record it is called "name").
For example, if I filter by QueryCode
"Q_1" on SalesTable
I see all "Q_1" queried sales orders.
When filtering by "" (blank) I see all orders, both with and without a QueryCode
populated.
Is this a limitation in the new RefRecId
functionality or is there something I need to change to be able to filter a blank foreign key reference field?
Edit;
The Customers list page can be used to see a standard example of this issue, personalize the grid to add "employee responsible" (the second in the list, the first is deleted). This is referenced by rec id and filtering the field by blank does not work. Filtering by employee name or not blank does (!"").
回答1:
Okay, I am of the opinion that this is a bug. However I have found a partial workaround.
In the example above a filter for a specific Employee Responsible name (including wildcards) will work, however a NOT filter or a blank filter will not.
To filter for blanks I would type the following in the filter field to query for a zero RecId directly;
(CustTable.MainContactWorker == 0)
or non blanks;
(CustTable.MainContactWorker != 0)
This does not fix the issue where filtering for something like !Anthony*
does not include blanks, but it will allow a list of blanks.
来源:https://stackoverflow.com/questions/21049145/filter-blanks-when-link-is-by-refrecid