I need to use two different filter for getting record in LIST form
filter1 ->for matching Myfield1
filter2 -> for matching Myfield2
get the matching records from the both filters like OR operation in filter condition.
rec.setfilter("Myfield1",value);
IF Rec.FIND('-') THEN
REPEAT
Rec.MARK(TRUE);
UNTIL Rec.NEXT = 0;
rec.setfilter("Myfield2",value);
IF Rec.FIND('-') THEN
REPEAT
Rec.MARK(NOT Rec.MARK);
UNTIL Rec.NEXT = 0;
Rec.MARKEDONLY(TRUE);
Unable to get the proper records in the list, missing somewhere !!!!
Solution Plz..
Regards,
Psk
0
Comments
do either rec.SETRANGE("Myfield1") or RESET to remove your first filter.
next added the code (Rec.SETRANGE(fld2);Rec.MARKEDONLY(TRUE)) after the second condition...showing only FIRST condition records, second one not taking the place...
What is wrong ???
The idea to get the OR-like filter is something like:
rec.SETRANGE(field1,value);
IF rec.FIND('-') THEN REPEAT
rec.MARK(TRUE);
UNTIL rec.NEXT = 0;
rec.SETRANGE(field1);// <-- Removes the filter on field1
rec.SETRANGE(field2,value);
IF rec.FIND('-') THEN REPEAT
rec.MARK(TRUE); // <- Just a mark. If the record is marked it remains marked. If it isn't it gets marked.
UNTIL rec.NEXT = 0;
rec.MARKEDONLY(TRUE);