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...
Answered

Restrict domain for a field

(0) ShareShare
ReportReport
Posted on by 45

I have created one page in that there is one field which email restriction in that field we can restrict some of the domains (eg: @edu.com, @outlook.com) mentioned domains will get restricted.

pastedimage1663673382656v1.png

And in Sales Order whenever select Customer if customer is with one of these email domain then it should give error Email is restricted 

please suggest 

Thank you.

I have the same question (0)
  • Suggested answer
    Amit Baru Profile Picture
    3,037 on at

    Hi,

    For this when trigger the email, check the domain form the Customer card and matching with that field and shows error.

    Regards

    Amit Sharma

    www.erpconsultors.com

  • Suggested answer
    YUN ZHU Profile Picture
    98,242 Super User 2026 Season 1 on at

    It seems possible.
    I suggest you can create a table with restricted emails. This is easier to handle.
    Then, as Amit mentioned, when the Email field is Onvalidate, verify whether there is a problem.

    The only problem is that you need to extract the part after the @ in the code to judge.

    Hope the following helps.

    https://yzhums.com/6471/

    Thanks.

    ZHU

  • Suggested answer
    Nitin Verma Profile Picture
    21,788 Moderator on at

    Hi,

    Adding for info.

    You can use below code to extract the domain values and implement it on OnBeforevalidate Event when you are trying to get Customer info.

    documenttext := 'youremail@domain.com';

    IF STRPOS(documenttext,'@') > 0 THEN

     documenttext := COPYSTR(documenttext,STRPOS(documenttext,'@'),STRLEN(documenttext));

    MESSAGE('%1',documenttext);

    Thanks.

  • PoojaZinjurke Profile Picture
    15 on at

    Thank you, This has worked

  • Pooja Zinjurke Profile Picture
    45 on at

    Thanks, It has worked

  • Suggested answer
    Nitin Verma Profile Picture
    21,788 Moderator on at

    Good to know.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,055 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 1,063 Super User 2026 Season 1

#3
Dhiren Nagar Profile Picture

Dhiren Nagar 1,014 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans