I need filter which choose records, which begins from letter "x" and exclude word "sort".
It must looks like this, i think: x*&<>*sort*
Help, pls
If RTFM - pls give me url of TFM. :-)
I need filter which choose records, which begins from letter "x" and exclude word "sort".
It must looks like this, i think: x*&<>*sort*
Help, pls
If RTFM - pls give me url of TFM. :-)
You can do it with 2 consequtive filter. So, first filter for the x*, the filter for <>*sort*
The code looks like this:
rec.SetFilter(field, 'x*');
rec.SetFilter(field, '<>*sort*');
if rec.FIND('-') then ....
Take into consideration, that filtering in Navision is case sensitive!
Hi!
If the "field" is the same in both SETFILTER commands, then the second is overrung the first one, so only the second filter is used.
And I think that there are some problems with <>*sort*. I try to set this kind of filter before and never done it. As I remember I had always used only *something* filter or *something1*|*something2*..
Casesenistivity can be solved using @ in the beging of the filter.
You are Right! I hope that in 3.6 it's implemented, but I tried and unfortunately NOT. The only way to disclose the records containing 'sort' in the field is the following:
rec.setfilter(field, 'x*');
if rec.find('-') then
repeat
if strpos(rec.field, 'sort') = 0 then begin
//do what you want,
//you can mark the fields and then using MARKEDONLY
end;
until rec.next = 0;
You can do it with 2 consequtive filter. So, first filter for the x*, the filter for <>*sort*
The code looks like this:
rec.SetFilter(field, 'x*');
rec.SetFilter(field, '<>*sort*');
if rec.FIND('-') then ....
Take into consideration, that filtering in Navision is case sensitive!
Hi!
If the "field" is the same in both SETFILTER commands, then the second is overrung the first one, so only the second filter is used.
And I think that there are some problems with <>*sort*. I try to set this kind of filter before and never done it. As I remember I had always used only *something* filter or *something1*|*something2*..
Casesenistivity can be solved using @ in the beging of the filter.
Comments
The code looks like this:
rec.SetFilter(field, 'x*');
rec.SetFilter(field, '<>*sort*');
if rec.FIND('-') then ....
Take into consideration, that filtering in Navision is case sensitive!
--
János Borsics
Hi!
If the "field" is the same in both SETFILTER commands, then the second is overrung the first one, so only the second filter is used.
And I think that there are some problems with <>*sort*. I try to set this kind of filter before and never done it. As I remember I had always used only *something* filter or *something1*|*something2*..
Casesenistivity can be solved using @ in the beging of the filter.
bostjanl
You are Right! I hope that in 3.6 it's implemented, but I tried and unfortunately NOT. The only way to disclose the records containing 'sort' in the field is the following:
rec.setfilter(field, 'x*');
if rec.find('-') then
repeat
if strpos(rec.field, 'sort') = 0 then begin
//do what you want,
//you can mark the fields and then using MARKEDONLY
end;
until rec.next = 0;
--
János Borsics
Did you try this
SETFILTER( Field, '%1|%2', '@x*', '<>*@sort*' );
It works
Regards
Jyotsna
Did you try this
RecVariable.SETFILTER( Field, '%1|%2', '@x*', '<>*@sort*');
It works
Regards
Jyotsna