Filter

KaktusKaktus Member Posts: 2
edited 2003-06-23 in Navision Attain
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. :-)

Comments

  • borsicsjborsicsj Member Posts: 32
    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!

    Kaktus wrote:
    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. :-)
    Brg,

    --
    János Borsics
  • bostjanlbostjanl Member Posts: 107
    borsicsj wrote:
    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.

    bostjanl
  • borsicsjborsicsj Member Posts: 32
    Hi!

    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;


    bostjanl wrote:
    borsicsj wrote:
    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.

    bostjanl
    Brg,

    --
    János Borsics
  • jyotsnasjyotsnas Member Posts: 62
    Hi

    Did you try this

    SETFILTER( Field, '%1|%2', '@x*', '<>*@sort*' );

    It works

    Regards
    Jyotsna
    ______Doubt is the father of Invension_______
  • jyotsnasjyotsnas Member Posts: 62
    Hi

    Did you try this

    RecVariable.SETFILTER( Field, '%1|%2', '@x*', '<>*@sort*');

    It works

    Regards
    Jyotsna
    ______Doubt is the father of Invension_______
Sign In or Register to comment.