Hi,
Can anyone tell me how to apply a filter on a form to exclude lines where for example Column 1 and Column 2 are null?
On the SourceTableView Property, when I am filtering
Column 1-Filter-<>'', Column 2-Filter-<>'',
it is filtering with OR condition and not with AND condition.
Thx for quick reply.
Rgds
Nalinee
0
Comments
What do you exactly want to do?
But the while I m trying to filter with SourceTableView Property, it is doing it with OR condition.
GD
It is filtering like it would if you apply filters to your table.
When applying as a standard view it should be coded on open form. That way you can still see all entries if you remove the filter.
yeah you can aslo do that to see two empty columns on the form
GD
SETFILTER(column1, <> '')
SETFILTER(column2, <> '')
has an OR operand.
What I need is an AND operand. How can this be done?
if (column1= '')and(column2='') then
Message('%1','C/AL is a Piece of Cake');
GD
I tried to put the filter on the form property with the settableview attribute BUT navision is not dispalying all records which has EITHER column1 OR colum2 as empty which not what I need. Only records which have both colum1 AND column 2 as empty should be filtered.
Is there a command which I can use to skip those records if column1 = '' AND column 2 = '' in the onaftergetrecord trigger?
WHERE("First condition"=FILTER(<>0),second condition=FILTER(<>0))
your setting up wrong filters [-X
instead of using '<>' u shud go for '=',in the SourceTableView property of the form
WHERE(Column1=FILTER(=''),Column2=FILTER(=''))
GD
You cannot do it with filters. You can do it with mark.
In the OnOpenForm trigger you can loop through the Rec, and MARK the records, which have to be displayed.
The solution is fine for a small database. The filter column 1 = empty AND column 2 = empty represent less than 1% of the records that need to be excluded in the display.
So marking the 99% of the records in a huge table is not practical and very time consuming.
please advise.
that's right... An other solution could be, to put a new field in to the table ("Fields Empty" - Boolean), and fill the field in the OnValidate triggers of your fields. Than you can create an index on this field, and filter on the form.
My problem is still pending.
Thx
setfilter(field1,'<>' + '''''');
setfilter(field2,'<>' + '''''');
in the OnOpenForm-Trigger?