Except '<>' in filters

hi,

i want to do the following filter

Filter on No. <> item1 and item2

Did you try
Item.SETFILTER(“No.”,’<>%1 & <>%2’,item1,item2);

it works like that , how can i do the following:

REPEAT

IF SalesInvoice not valid THEN

IF RejectedDocNO = ‘’ then

RejectedDocNO := SH.“No.”

ELSE

RejectedDocNO += ‘|’ + SH.“No.”

UNTIL SH.NEXT = 0

SETFILTER(“Document No.”,’<>%1’, RejectedDocNO );

Where did you write this code?

in a codeunit, the filter will be like the following:

SETFILTER(“Document No.”,’<>%1’,item1|item2|item3|item4,…)

Did you try to print the RejectedDocNO using a message before SETFILTER?

RejectedDocNO = item1|item2|item3|item4|…

Did you try with

SETFILTER(“Document No.”,RejectedDocNO );

i want to filter except the rejecteddoc [ <> RejectedDocNO ]

I never used it with <>…

why dont you modify your login

REPEAT

IF SalesInvoicevalid THEN

IF AcceptedDocNO = ‘’ then

AcceptedDocNO := SH.“No.”

ELSE

AcceptedDocNO += ‘|’ + SH.“No.”

UNTIL SH.NEXT = 0

SETFILTER(“Document No.”,AcceptedDocNO );