web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Suggested answer

How to check if field contains more than one filter

(0) ShareShare
ReportReport
Posted on by 104

Hello. I have record and field. This field contains 1, 2, 3 or 4 location code filters. For example:

WHITE

WHITE|GREEN

WHITE|GREEN|RED

WHITE|GREEN|RED|BLUE

What is the most optimal (and simplest) way to check if number of location code filter is greater than 1?

I do this task in this way:

FilterTemp: Text

FilterTemp := Record.GetFilter("Location Code");

if FilterTemp.contains('|');

But im not sure that this is good way.

And how can I count number of Location Code filters in this example? I think I can count '|' in FilterTemp and result+1 will be correct answer. But maybe exists easier way?

I have the same question (0)
  • Suggested answer
    DAnny3211 Profile Picture
    11,389 on at
    RE: How to check if field contains more than one filter

    CIao

    you can use the following function

    learn.microsoft.com/.../text-split-list[text]-method

    check my answer if it was helpful, thanks

    DAniele

  • Suggested answer
    YUN ZHU Profile Picture
    93,820 Super User 2025 Season 2 on at
    RE: How to check if field contains more than one filter

    Hi, just adding some info.

    If only '|' is considered, I think a bug will occur.

    In fact we can also use "..." to filter the Location Code.

    For example,

    EAST..OWN LOG

    pastedimage1668579269069v2.png

    pastedimage1668579232952v1.png

    Hope this helps as well.

    Thanks.

    ZHU

  • Suggested answer
    YUN ZHU Profile Picture
    93,820 Super User 2025 Season 2 on at
    How to check if field contains more than one filter
    Sorry for the late confirmation, hope the following helps.
    Dynamics 365 Business Central: How to check if there is only one value in the filter for a field (For example, check if number of G/L Account No. filter is greater than 1)
     
     
    Thanks.
    ZHU

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Pallavi Phade – Community Spotlight

We are honored to recognize Pallavi Phade as our Community Spotlight honoree for…

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
Sumit Singh Profile Picture

Sumit Singh 2,163

#2
OussamaSabbouh Profile Picture

OussamaSabbouh 1,908

#3
YUN ZHU Profile Picture

YUN ZHU 1,878 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans