Filtering Item No.

I have a simple problem but very annoy me… I have Item No : MMNOOONU567/9-1 PHEETELGBY450/1-1 PHEETELGBY450/1-3 PHEETELGBY45/1-1 PHEETELGBY45/1-4 I want to filter all item PHEETELGBY but NOT all item PHEETELGBY450. the result must be like this : PHEETELGBY45/1-1 PHEETELGBY45/1-4 I try code like this one : Item.setfilter(“No.”,’%1 & <> %2’,‘PHEETELGBY*’,‘PHEETELGBY450’); but the result is not like I want… Anyone can help me…please advise soonnnn… Thx

I have a feeling more conditions will emerge, but for the item numbers in your post this filter does the trick: PHEETELGBY??/* Edit… This seems to work too and is probably more accurate: (<PHEETELGBY450/1|>PHEETELGBY450/9)&PHEETELGBY*

Sorry,I mean : Item.setfilter(“No.”,’%1 & <> %2’,‘PHEETELGBY*’,‘PHEETELGBY450*’) PHEETELGBY450/1-3 not only a number after backslash(’/’) but it can be PHEETELGBY450/S-U or something else,So I filter it ‘PHEETELGBY450*’ but still can work as I want… ???

Sorry, but filters like ‘<>XXX*’ works only on MS SQL and Navision 3.70+ For Native DB and Older Navision only <>XXX can be used (without wildcards)… Use Marks for your purpose…

Are you sure?? So,there is no solution…:frowning:

Arnoldus, Never tried this? VarMyItemNbr := delstr(“item no.”,11); VarMyItemNbr2:= delstr(“item no.”,14); item.SETFILTER(“item no.”,’<>%1|=%2’,VarMyItemNbr2,VarMyItemNumber ) Regards [:D]

You can use filtergroups Try this Filtergroup := A; Setrange(no,‘BLABLA*’); Filtergroup := B; SETFILTER(no,’<>%1’,‘BLABLAXXX’); It should work

How to use filtergroup?I never use this function before. I have try like this : Item refer to Item table Item2 refer to New Item table(but not temporary table) to see the result of filter Item.FILTERGROUP := 5; Item.SETRANGE(“No.”,‘PHEETELGBY*’); Item.FILTERGROUP := 6; Item.SETFILTER(“No.”,’<>%1’,‘PHEETELGBY450*’); IF Item.FIND(’-’) THEN BEGIN REPEAT Item2.INIT; Item2.“No.” := Item.“No.”; Item2.INSERT; UNTIL Item.NEXT = 0; END; The result : show all Item…???

When I have to use “complex” filters, I initially set a first-filter. Then OnAfterGetRecord I make a further check. In your case somthing like this: Item.SETFILTER("No.",'%1*','PHEETELGBY'); OnAfterGetRecord: IF STRPOS(Item."No.",'450') > 0 THEN CurrReport.SKIP; Perhaps you can use this solution…

Not On Report,but On CodeUnit…

Hi, Try this line. item.SETFILTER(“No.”,’%1 & %2’,‘PHEETELGBY*’,‘450’); Regards.

Hi, Previous one only filters 450 numbered items. try these lines. item.SETFILTER(“No.”,’%1’,‘PHEETELGBY*’); IF item.FIND(’-’) THEN REPEAT IF STRPOS(item.“No.”,‘450’)=0 THEN BEGIN MESSAGE(’%1’,item.“No.”); item.MARK(TRUE); END; UNTIL item.NEXT = 0; item.MARKEDONLY(TRUE); MESSAGE(’%1’,item.COUNT); regards