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...
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
    RE: Restrict domain for a field

    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
    95,307 Super User 2025 Season 2 on at
    RE: Restrict domain for a field

    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,698 Moderator on at
    RE: Restrict domain for a field

    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
    RE: Restrict domain for a field

    Thank you, This has worked

  • Pooja Zinjurke Profile Picture
    45 on at
    RE: Restrict domain for a field

    Thanks, It has worked

  • Suggested answer
    Nitin Verma Profile Picture
    21,698 Moderator on at
    RE: Restrict domain for a field

    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

Responsible AI policies

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

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 3,377

#2
Jainam M. Kothari Profile Picture

Jainam M. Kothari 2,696 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 1,512 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans