Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

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

OnLookup - SetFilter and regex?

(0) ShareShare
ReportReport
Posted on by 130

Hi all,

I am able to filter a field on a specific page to only include relevant results. 

However, I would like to implement a RegEx (or some method) so that I filter results once, and then filter again for results that start with 3 letters (E.g. ABC , DEF, CAT)

Any thoughts?

  • Suggested answer
    YUN ZHU Profile Picture
    85,819 Super User 2025 Season 1 on at
    RE: OnLookup - SetFilter and regex?

    Hi, In that case, you can try to extract the first three characters, and then use a loop to determine whether they are all alphabetical letters.

    The following is an example of judging whether it is a number, I think it can be used as a reference.

    http://adnavtech.blogspot.com/2017/06/how-to-check-string-is-number-or-letter.html

    Hope this helps.

    Thanks.

    ZHU

  • SammySevens Profile Picture
    130 on at
    RE: OnLookup - SetFilter and regex?

    Hi Zhu,

    I feel privileged to get an answer from you! I read your posts all the time!

    Unfortunately the letters are not fixed, what I'd like is to filter out anything that begins with 3 alphabetical letters ([a-z])

  • Suggested answer
    YUN ZHU Profile Picture
    85,819 Super User 2025 Season 1 on at
    RE: OnLookup - SetFilter and regex?

    Hi, are these three letters fixed?

    If so it's relatively simple.

    For example, you can use following ABC* to represent data beginning with ABC.

    Item.SETFILTER("No.",'ABC*');

     

    Hope this can give you some hints.

    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

Ramesh Kumar – Community Spotlight

We are honored to recognize Ramesh Kumar as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

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

#1
Sohail Ahmed Profile Picture

Sohail Ahmed 2,655

#2
Mansi Soni Profile Picture

Mansi Soni 1,574

#3
YUN ZHU Profile Picture

YUN ZHU 1,453 Super User 2025 Season 1

Featured topics

Product updates

Dynamics 365 release plans