Setfilter on Boolean Field

Hi all! How can I set a Filter an a Boolean Field with the SETFILTER Command? I already used record.setfilter(fieldname.booleanvariable), but it semms it doesn’t work… why? thnx and regards sven Best regards Sven Sauer Dolphin Communications GmbH Cycos AG [a]www.dolphinct.de[/a] [a]www.cycos.com[/a] [a]sauer@dolphinct.de[/a]

Hi Sven, → Record.SETFILTER(Record.Booleanfield,’%1’,TRUE); This works. But why don’t you use the setrange-Command ? Richard

because setrange doesn’t work, too. Setfilter with ‘%1’,varname ist the same as a fixed string like ‘yes’. and this I already tried as well…

Record.SETRANGE(BooleanField,TRUE) You do not need record.booleanfield because the record is implicit from the record which preceeds the SETRANGE (or SETFILTER) command. Works for me. Cheers, John

I have noticed that in some instances SETRANGE only seems to work if it is part of the selected Key. SETRANGE(BoolField,TRUE); In Key SETFILTER(BoolField,’%1’,TRUE); Not In Key New Users Note: you can’t filter on a flowfield. David Cox MindSource (UK) Limited Navision Solutions Partner Email: david@mindsource.co.uk Web: www.mindsource.co.uk

Sven, It may sound as quite obvious, but setting a filter/range will have no visible effect until you do some read action (GET or FIND) on the table. Compare it with manual filtering, you can type in anything you like, but there’s no action before you do Apply or OK. Perhaps you can show us a bit more of the code you are having trouble with? John

Hi Sven, The statement Record.SETFILTER(Record.Booleanfield,’%1’,TRUE); does not work for you ? I tried and it works fine. What exactly do you do ? Richard

I have done Record.Setrange(boolean, true); before, there was no problems. I’ve written and compiled it, What exactly went wrong when you tried it Sven? Regards Tony

Ok, this simple issue have been discussed enough i think :-). So summa summarum: SETFILTER(“Boolean”,TRUE); or SETRANGE(“Boolean”,TRUE); will work. Best regards, Soren Nielsen, moderator Navision Online User Group