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

Announcements

No record found.

News and Announcements icon
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?

  • Suggested answer
    DAnny3211 Profile Picture
    11,423 Super User 2026 Season 1 on at

    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
    103,085 Super User 2026 Season 2 on at

    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
    103,085 Super User 2026 Season 2 on at
    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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders

These are the community rock stars!

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 711 Super User 2026 Season 2

#2
Teagen Boll Profile Picture

Teagen Boll 377 Super User 2026 Season 2

#3
AndrewThomas81 Profile Picture

AndrewThomas81 367 Super User 2026 Season 2

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans