web
You’re offline. This is a read only version of the page.
close
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

How to make a field required

(0) ShareShare
ReportReport
Posted on by 35

I can see in the AL that you can set the NotBlank field attribute to make a field required. If I was creating a custom field then I could make it required however I cannot modify this attribute on stock fields. I have a customer that would like a stock field made required. How can I make a work-around for this? I figure I would need to in a page extension create a OnInsert or OnUpdate validation logic but I don't see any documentation on how to do this properly.

I have the same question (0)
  • Suggested answer
    JAngle Profile Picture
    133 on at

    This post might be worth looking at: mohana-dynamicsnav.blogspot.com/.../how-to-modify-existing-field-and-action.html

  • tanya07 Profile Picture
    1,638 on at

    Hope this suggestion helps to make a field mandatory/required on page level , we could simply use OnQueryClosePage() trigger where you could use a logic like this :

    IF stock <> ' ' THEN

    ERROR('Fill the required field');

    END;

  • Suggested answer
    Salah Eddine BENOUALA Profile Picture
    485 on at

    Hi Andrew,

    You can give you field as parameter to TESTFIELD function where you want to control empty value. 

    If it is empty it will automatically trigger an error.

    TESTFIELD(stock);


    -----------------------------------------

    Best Regards,

    Salah Eddine BENOUALA

    Dynamics NAV & 365 Business Central Consultant

    Please verify my answer, if you find it helpful.

    Doing so you'll show others that there was found a solution and you credit my help.

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 2,238

#2
YUN ZHU Profile Picture

YUN ZHU 773 Super User 2025 Season 2

#3
Sumit Singh Profile Picture

Sumit Singh 630

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans