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 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
    157 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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,060 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 1,086 Super User 2026 Season 1

#3
Khushbu Rajvi. Profile Picture

Khushbu Rajvi. 700 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans