Dynamics 365 Business Central: Entering Criteria in Filters (Not equal to multiple criteria)

Dynamics 365 Business Central

Hi, Readers.
A few days ago, I was asked an interesting question, how to combine “Not equal to” format expressions when entering Criteria in Filters (Not equal to multiple criteria). This is not a very difficult question. In this post, I would like to briefly share information about how to enter criteria in filters in Business Central.

First of all, for the most basic information, I recommend BC Productivity tips (a print-friendly overview of the most used functions).
More details: An fantastic document for end users before Go-Live (BC Productivity tips)

Then Microsoft prepared the following detailed documentation.

Entering Criteria in Filters:

When you enter criteria, you can use all the numbers and letters that you can normally use in the field. In addition, you can use some special symbols or mathematical expressions. Here are the available formats:

SymbolMeaningSample ExpressionRecords Displayed
=Equal to377Number 377
BLUEThose with the BLUE code, for example, the BLUE warehouse code
22A datetime: from 22-current month-current year 0:00:00 to 22-current month-current year 22:59:59
22 10An exact datetime: 22-01-01 10:00:00
..Interval1100..2100Numbers 1100 through 2100
..2500Up to and including 2500
..12 31 00Dates up to and including 12 31 00
P8..Information for accounting period 8 and thereafter
..23From the beginning of time until 23-current month-current year 23:59:59
23..From 23-current month-current year 0:00:00 until the end of time
22..23From 22-current month-current year 0:00:00 until 23-current month-current year 23:59:59
|Either/or1200|1300Those with number 1200 or 1300
&And<2000&>1000Numbers that are less than 2000 and greater than 1000.

The & sign cannot be used by itself with numbers because no record can have two numbers.
<>Not equal to<>0All numbers except 0
>Greater than>1200Numbers greater than 1200
>=Greater than or equal to>=1200Numbers greater than or equal to 1200
<Less than<1200Numbers less than 1200
<=Less than or equal to<=1200Numbers less than or equal to 1200
*An indefinite number of unknown charactersCoTexts that contain “Co”
*CoTexts that end with “Co”
Co*Texts that begin with “Co”
?One unknown characterHans?nTexts such as Hansen or Hanson
Calculate before rest30|(>=10&<=20)Those with number 30 or with a number from 10 through 20 (the result of the calculation within the parentheses)
@Ignore case (either uppercase or lowercase allowed)@locationTexts such as LOCATION, location or Location

You can also combine the various format expressions:

ExpressionDescription
5999|8100..8490Include any records with the number 5999 or a number from the interval 8100 through 8490.
..1299|1400..Include records with a number less than or equal to 1299 or a number equal to 1400 or greater (all numbers except 1300 through 1399).
>50&<100Include records with numbers that are greater than 50 and less than 100 (numbers 51 through 99).
C&*D*Texts containing both C and D.
@co?Texts containing co, CO, Co, cO, such as cot, cope and incorporated.

CO, cO, Co or co must be present, followed by at least one character, but there can be an indefinite number of characters before and after these, and case is unimportant.

Similar information as above can be found in Filter criteria and symbols.

But there is no expression of Not equal to multiple criteria in the table. So if users or partners without NAV experience, the following errors may occur.

N.G.

<>10000&20000: Include any records with the number equal to 20000 and not equal to 10000.

<>10000|20000: Include any records with the number equal to 20000 or the number not equal to 10000.

Good:

<>10000&<>20000 (Need to use the Not equal symbol multiple times)

Let’s look at another example.

Filter Description on the Item List page:

<>ATHENS Desk&<>PARIS Guest Chair, black&<>ATHENS Mobile Pedestal

You can also append parentheses to each condition and this will also take effect.
(<>ATHENS Desk)&(<>PARIS Guest Chair, black)&(<>ATHENS Mobile Pedestal)

Very simple, isn’t it? Give it a try!!!😁

PS:
1. When filtering some data containing special characters, you need to add single quotes.

2. The filter expression can be used in Record.SetFilter(Any, Text [, Any,…]) Method

3. As for the use in development, here is a simple example: How to find duplicates via AL (Filter for duplicate values)

END

Hope this will help.

Thanks for reading.

ZHU

コメント

Copied title and URL