Setting Filter in multiple field in the same record

SimoGsiSimoGsi Member Posts: 23
Hello All,

I am developping a function in C/Al , i wanna set a filter for 3 fields on one table
to do this i do :
rec.SETFILTER(Field,'<>%1','AR*');
rec.SETFILTER(Field1,'<>%1','TR*');
rec.SETFILTER(Field2,'<>%1','VR*');

but i doesn't seem to work when i iterate through this record(it still generating all records including ones staring with AR.......)

Can you pls help me to resolve this problem

Thank you in advance
Navision

Comments

  • jemmyjemmy Member Posts: 247
    Hi SimoGsi,

    yeah, you couldn't use '<>%1' in SETFILTER.

    Try to rewrite your code like these:
    rec.SETFILTER(Field,'<>AR*');
    rec.SETFILTER(Field1,'<>TR*');
    rec.SETFILTER(Field2,'<>VR*');
    

    hope this helps, :wink:

    Jemmy
  • SteveOSteveO Member Posts: 164
    That's not entirely true...
    You can use '<>%1' in SETFILTER but you cannot use the * wildcard when using <> unless you are using the SQL version.

    Try this (for example).

    SETFILTER(FIELD1, '<AR|>AR*');

    I have tried quickly myself on a few records and it seems to work fine.
    This isn't a signature, I type this at the bottom of every message
  • jemmyjemmy Member Posts: 247
    Hi Steve,

    Thanks for the correction.. :wink:

    Jemmy
  • RobertMoRobertMo Member Posts: 484
    Haven't I already read this today?
    Oh,yes...
    http://www.mibuso.com/forum/viewtopic.php?t=4195
               ®obi           
    ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Sign In or Register to comment.