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 :
Business Central forum

Making Fields Mandatory

(0) ShareShare
ReportReport
Posted on by 2,487

Is it possible to make a field mandatory in BC, using Personalization?

Categories:
  • Mary Myers Profile Picture
    2 on at

    @James, what fields do you want to be mandatory?  Those will typically be under parameter settings

  • SU-22040800-0 Profile Picture
    2,487 on at

    Hi Mary - specifically I'm looking at making the Vat Prod Posting Group on the Sales Invoice line, mandatory.

  • Suggested answer
    Mary Myers Profile Picture
    2 on at

    So what you can do is set up the VAT Tax code, and set a default code on your customers.  You can set the vat area code, which is directed to the Prod. Posting group.  So while it wouldn't be mandatory, it will automatically fill in with the correct information.  Do you think there is a reason that this would not work for you?

  • Suggested answer
    Stefano Demiliani Profile Picture
    37,172 Most Valuable Professional on at

    For new tables (your custom tables), you can use the ShowMandatory field property. ShowMandatory property is ACTUALLY not supported on pageextension objects (so on standard fields) and the official reason is that generally the AL Team don't expose properties that would lead to conflicting/undefined behavior in case 2 or more extensions modify the same property.

    For standard fields use can use TESTFIELD or custom code in a pageextension or a tableextension object.

  • SU-22040800-0 Profile Picture
    2,487 on at

    Unfortunately not, Mary. Thanks for the suggestion though.

  • SU-22040800-0 Profile Picture
    2,487 on at

    Thanks Stefano

    So am i guessing that i would go into 'DESIGN' mode in the Sandbox environment, and adjust it there?

  • SU-22040800-0 Profile Picture
    2,487 on at

    Thanks Stefano

    So am i guessing that i would go into 'DESIGN' mode in the Sandbox environment, and adjust it there?

  • Suggested answer
    Stefano Demiliani Profile Picture
    37,172 Most Valuable Professional on at

    As said, you cannot change the ShowMandatory property of a standard field. For custom fields, you can set this property in your extension (AL file) directly (no designer).

    For existing fields, if you want to have a field mandatory in your extension you can use something like TESTFIELD(YourField) on your page or table object.

  • SU-22040800-0 Profile Picture
    2,487 on at

    Thanks Stefano

  • Andrew Esther Profile Picture
    35 on at

    How would you create a page extension that would validate a stock field is filled in before it saves? Customer is requesting that the Order Date be filled in on every Sale Order. I cannot change the NotBlank attribute in AL.

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

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard > Business Central

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans