How to: Create a Mandatory Field

In this walkthrough we create a Mandatory Field using the Microsoft Dynamics 365 Business Central extension Compliance Field Validation. Mandatory field is one of the six types of validation the other types are:

  • Mandatory: field cannot be empty;
  • Filter: apply a filter on a field like you would when filtering in Dynamics on the field. You can use this one for your case, a decimal field that should have a value >100
  • Length: length of a field, for instance a phone no. must be 10 digits;
  • Related No. of Records: can be used on a related table, for instance a customer must have a at least one valid sales price;
  • Related Field: compare related fields to each other, for instance on a sales order the customer posting group must be the same as on the customer card;
  • Regular Expression: can be used with regex commands, anything you can do with regex you can apply.

The setup is active for any user logged in to any company. The extension works for any table in Business Central: default, extension and custom objects are supported.

Refer to for more information on filtering in Dynamics 365 Business Central. Our Compliance modules support any filtering capability offered by default Business Central.

Follow these steps to create a Field Validation to validate specific fields of a table.

1. In the top right corner, choose the Search for Page or Report icon, enter Field Validations List and choose the related link.

2. In the Field Validations List window click New.

3. Complete the following fields in the header.

  • No.: Automatic and / or manual, based on the number series settings.
  • Description: E.g. Secure posting groups items.
  • Table ID: Select the ID of the table that you want to secure on field level.
  • Validation Type: Error or Warning

4. Compared to Field Validation, the Permission Set for whcih the Field Validation is valid must be entered in the header, specifically in the field: Valid for Permission Set ID. If you leave the field empty, the validation applies to all Users. Permission Sets are not looked at.

5. Add the fields that are mandatory filled in by clicking AssistEdit button of the Field No. on the first line. A list with all fields in the table opens.

6. The field Notification on the line allows you to specify your own Error message or Warning.

7. The Field Validation is inactive until the Starting Date contains a date in the past or today. Furthermore, the Field Validation is inactive when the field End Date contains a date in the past.

8. If the user(s) for which you have setup a Field Validation logs out of Dynamics 365 Business Central and logs in again, the field Field Validation is activated.

  • complianceapps/4field_validation/walkthroughs/1create_a_field_validation.txt
  • Last modified: 2022/04/01 14:21
  • by bas